/*
Theme Name: LogickeHry.cz
Theme URI: https://logickehry.cz
Author: Ty
Description: Hravá a barevná šablona pro logické herní weby.
Version: 1.3
License: GNU General Public License v2 or later
*/

/* --- 1. PROMĚNNÉ A ZÁKLAD --- */
:root {
    --primary: #6366f1;   /* Indigo */
    --primary-dark: #4f46e5;
    --accent: #ec4899;    /* Růžová */
    --accent-glow: rgba(236, 72, 153, 0.4);
    
    --bg-body: #f8fafc;
    --bg-pattern: #eef2ff;
    --bg-card: #ffffff;
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --tag-bg: #f1f5f9;
    
    --gradient-main: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    
    --nav-height: 85px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg-body);
    background-image: radial-gradient(var(--bg-pattern) 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .logo, .btn { font-family: 'Fredoka', sans-serif; }
a { text-decoration: none; color: inherit; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* --- 2. NAVIGACE --- */
nav {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 0 3%;
    height: var(--nav-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.5);
}

.nav-brand { display: flex; flex-direction: column; justify-content: center; flex-shrink: 0; }
.logo { 
    font-size: 1.8rem; font-weight: 700; 
    background: var(--gradient-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    line-height: 1.1; letter-spacing: -0.5px;
}
.nav-slogan { font-size: 0.75rem; color: var(--text-muted); font-weight: 700; margin-top: 2px; }

/* Hledání */
.search-container { flex-grow: 1; max-width: 450px; margin: 0 2rem; position: relative; }
.search-input {
    width: 100%; padding: 0.8rem 3rem 0.8rem 1.2rem; border-radius: 50px;
    border: 2px solid #e2e8f0; background-color: #fff;
    font-family: 'Nunito', sans-serif; font-size: 0.95rem; font-weight: 600;
    transition: all 0.3s ease; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15); }
.search-btn {
    position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer;
}
.search-btn:hover { color: var(--primary); transform: translateY(-50%) scale(1.1); }

/* Pravé menu (WordPress) */
.nav-right { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.nav-menu li { margin: 0; }

.nav-menu a { 
    display: block;
    font-weight: 700; 
    color: var(--text-muted); 
    font-size: 1rem; 
    padding: 8px 12px; 
    border-radius: 10px; 
    text-decoration: none;
}

.nav-menu a:hover { color: var(--primary); background: #f1f5f9; }
.nav-menu .current-menu-item a { color: var(--primary); background: #f1f5f9; }

/* Tlačítko přihlášení */
.btn-login {
    background: var(--text-main); color: white; padding: 0.6rem 1.5rem;
    border-radius: 50px; font-weight: 700; font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.btn-login:hover { background: var(--primary); transform: translateY(-2px); box-shadow: 0 6px 15px rgba(99, 102, 241, 0.3); color: white; }

/* --- 3. LAYOUT & SIDEBAR --- */
.layout-wrapper {
    max-width: 1280px; margin: 0 auto; padding: 40px 20px;
    display: flex; gap: 40px; align-items: flex-start; flex-grow: 1; width: 100%;
}

aside.sidebar { width: 260px; flex-shrink: 0; display: flex; flex-direction: column; gap: 30px; }
.sidebar-box { background: transparent; }
.sidebar-box.boxed { background: var(--bg-card); padding: 1.5rem; border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }

.sidebar-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 1rem; color: var(--text-main); display: flex; align-items: center; gap: 8px; }

/* Kategorie v sidebaru */
.category-list li { margin-bottom: 0.5rem; }
.category-list a {
    display: flex; align-items: center; padding: 0.6rem 1rem; border-radius: var(--radius-md);
    color: var(--text-muted); font-weight: 700; background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03); border: 1px solid transparent;
}
.category-list a:hover { color: var(--primary); border-color: var(--primary); transform: translateX(5px); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1); }

/* Štítky */
.sidebar-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.sidebar-tag {
    font-size: 0.8rem; background: white; padding: 6px 14px; border-radius: 20px;
    color: var(--text-muted); font-weight: 700; border: 1px solid #e2e8f0;
}
.sidebar-tag:hover { background: var(--accent); color: white; border-color: var(--accent); box-shadow: 0 4px 10px var(--accent-glow); }

/* Top hry v sidebaru (Jednosloupec) */
.top-game-thumb { 
    display: block; 
    width: 100%; 
    border-radius: var(--radius-sm); 
    overflow: hidden; 
    aspect-ratio: 16/9; 
    position: relative;
    margin-bottom: 15px; /* Mezera mezi hrami */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Poslední hra nemá mezeru dole */
.top-game-thumb:last-child { margin-bottom: 0; }

.top-game-thumb img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: 0.4s; 
}

.top-game-thumb:hover img { 
    transform: scale(1.1); 
}

/* --- 4. GRID HER (Main Loop) --- */
main.content { flex-grow: 1; width: 100%; }
.game-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }

.game-card {
    display: block; background: var(--bg-card); border-radius: var(--radius-lg);
    overflow: hidden; box-shadow: var(--shadow-card); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%; position: relative; border: 1px solid rgba(0,0,0,0.03); transform: translateY(0);
}
.game-card:hover { transform: translateY(-8px) scale(1.01); box-shadow: var(--shadow-hover); }

.card-image { width: 100%; height: 180px; overflow: hidden; position: relative; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.game-card:hover .card-image img { transform: scale(1.1); }

.card-category-badge {
    position: absolute; top: 15px; left: 15px; background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px); padding: 4px 10px; border-radius: 8px; font-size: 0.7rem;
    font-weight: 800; color: var(--primary); text-transform: uppercase; box-shadow: 0 4px 10px rgba(0,0,0,0.1); z-index: 10;
}

.play-overlay {
    position: absolute; inset: 0; background: rgba(99, 102, 241, 0.8);
    display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s;
}
.game-card:hover .play-overlay { opacity: 1; }
.play-icon { font-size: 3rem; color: white; transform: scale(0.5); transition: transform 0.4s; }
.game-card:hover .play-icon { transform: scale(1); }

.card-content { padding: 1.2rem; }
.game-card h3 { font-size: 1.25rem; color: var(--text-main); margin-bottom: 0.8rem; font-weight: 600; }
.game-card:hover h3 { color: var(--primary); }

.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-tag { font-size: 0.75rem; color: var(--text-muted); background: #f1f5f9; padding: 4px 10px; border-radius: 6px; font-weight: 600; text-decoration: none; }
.mini-tag:hover { color: var(--primary); }

/* --- 5. DETAIL HRY & STRÁNKY (Single & Page) --- */
.breadcrumbs { margin-bottom: 1.5rem; font-size: 0.95rem; color: var(--text-muted); font-weight: 600; }
.breadcrumbs span { margin: 0 8px; color: #cbd5e1; }
.breadcrumbs a:hover { color: var(--primary); }

/* Game Wrapper */
.game-wrapper { margin-bottom: 2rem; }

/* Info Grid */
.info-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; margin-bottom: 3rem; }
.content-box { background: var(--bg-card); padding: 2rem; border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }

/* WP Entry Content Styles */
.entry-content p { margin-bottom: 1.2rem; color: var(--text-muted); line-height: 1.8; }
.entry-content h2, .entry-content h3 { margin-top: 1.5rem; margin-bottom: 0.8rem; color: var(--text-main); font-weight: 700; }
.entry-content ul { list-style: disc; padding-left: 20px; margin-bottom: 1.5rem; color: var(--text-muted); }
.entry-content a { color: var(--primary); font-weight: 600; }

/* Akční tlačítka */
.action-btn {
    background: #f1f5f9; color: var(--text-muted); border: none; padding: 0.7rem 1.2rem;
    border-radius: 50px; font-weight: 700; font-family: 'Nunito', sans-serif; cursor: pointer;
    transition: 0.2s; display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
}
.action-btn:hover { background: #e2e8f0; color: var(--text-main); }
.action-btn.primary { background: var(--primary); color: white; box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3); }
.action-btn.primary:hover { background: var(--primary-dark); }

/* --- 6. NAŠEPTÁVAČ (AJAX SEARCH) --- */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 15px;
    right: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 9999;
    margin-top: 10px;
    border: 1px solid #f0f0f0;
    overflow: hidden;
}
.search-results-dropdown ul { list-style: none; margin: 0; padding: 0; }
.search-result-item { display: flex; align-items: center; padding: 10px 15px; border-bottom: 1px solid #f8f9fa; transition: background 0.2s; text-decoration: none; }
.search-result-item:hover { background: #f1f5f9; }
.search-result-img { width: 40px; height: 40px; border-radius: 6px; overflow: hidden; margin-right: 12px; flex-shrink: 0; }
.search-result-img img { width: 100%; height: 100%; object-fit: cover; }
.search-result-info { display: flex; flex-direction: column; }
.search-result-title { font-weight: 700; font-size: 0.95rem; color: var(--text-main); line-height: 1.2; }
.search-result-cat { font-size: 0.75rem; color: var(--primary); font-weight: 600; margin-top: 2px; }
.view-all-results { display: block; text-align: center; padding: 10px; background: #f8fafc; color: var(--primary); font-weight: 700; font-size: 0.9rem; }
.view-all-results:hover { background: #e2e8f0; text-decoration: underline; }
.no-results { padding: 15px; text-align: center; color: var(--text-muted); font-size: 0.9rem; }

/* --- 7. PATIČKA --- */
footer {
    background-color: white; padding: 4rem 0 2rem 0; margin-top: 4rem;
    border-top: 1px solid #f1f5f9; position: relative; overflow: hidden;
}
footer::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--gradient-main); }

.footer-container { max-width: 1250px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; }
.footer-col h4 { font-size: 1.1rem; margin-bottom: 1.5rem; color: var(--text-main); font-weight: 700; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.8rem; }
.footer-links a { color: var(--text-muted); font-size: 0.95rem; font-weight: 600; text-decoration: none; }
.footer-links a:hover { color: var(--accent); padding-left: 5px; }

.footer-logo { font-size: 1.8rem; font-weight: 700; color: var(--primary); margin-bottom: 1rem; display: inline-block; font-family: 'Fredoka', sans-serif; }
.footer-desc { font-size: 0.95rem; color: var(--text-muted); line-height: 1.7; }
.footer-bottom { text-align: center; margin-top: 4rem; padding-top: 2rem; border-top: 1px solid #f8fafc; color: #94a3b8; font-size: 0.9rem; }

/* --- 8. RESPONZIVITA --- */
@media (max-width: 1024px) {
    .game-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-container { grid-template-columns: 1fr 1fr; }
    .search-container { margin: 0 1rem; }
}

@media (max-width: 768px) {
    nav { height: auto; flex-wrap: wrap; padding: 15px; gap: 15px; }
    .nav-brand { width: 50%; }
    .nav-right { width: 50%; justify-content: flex-end; }
    .search-container { order: 3; width: 100%; max-width: 100%; margin: 0; }
    .search-input { padding-top: 0.7rem; padding-bottom: 0.7rem; }
    
    .layout-wrapper { flex-direction: column; padding: 20px 15px; }
    aside.sidebar { width: 100%; order: 2; }
    .category-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    
    .game-grid { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
    .game-viewport { height: 350px; }
    .game-bar { flex-direction: column; gap: 15px; text-align: center; }
    
    /* Skrytí menu na mobilu */
    .nav-menu, .nav-slogan { display: none; }
    .footer-container { grid-template-columns: 1fr; gap: 30px; }
}

/* --- STYLY PRO EXISTUJÍCÍ BLOK INSTRUKCÍ --- */
/* Cílíme na třídu, kterou už používáte v editoru */
.entry-content .is-style-controls-box {
    background-color: #f5f7ff; /* Světlá fialová */
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
    margin-bottom: 30px;
    border-left: 5px solid var(--primary); /* Fialový pruh vlevo */
}

/* Pokud je uvnitř nadpis, přebarvíme ho na fialovo */
.entry-content .is-style-controls-box h2,
.entry-content .is-style-controls-box h3,
.entry-content .is-style-controls-box h4,
.entry-content .is-style-controls-box strong {
    color: var(--primary) !important;
    margin-top: 0;
}

/* Vylepšení pro klávesy v textu (pokud používáte např. tag <kbd> nebo span) */
.is-style-controls-box kbd, 
.key-tag {
    display: inline-block;
    background: white;
    border: 1px solid #cbd5e1;
    border-bottom: 3px solid #cbd5e1;
    color: #1e293b;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-family: monospace;
    font-size: 0.9em;
    margin: 0 3px;
    vertical-align: middle;
}

/* --- 9. STRÁNKOVÁNÍ (Pagination) --- */
.navigation.pagination {
    margin-top: 40px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.navigation.pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Skrytí nadpisu "Navigace pro příspěvky", který WP generuje pro čtečky */
.navigation.pagination h2.screen-reader-text {
    display: none;
}

/* Styl pro jednotlivá čísla a tlačítka Další/Předchozí */
.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: #fff;
    color: var(--text-muted);
    font-weight: 700;
    font-family: 'Fredoka', sans-serif;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    min-width: 45px; /* Aby byla čísla hezky čtvercová/obdélníková */
}

/* Hover efekt */
.page-numbers:hover:not(.current) {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
    background: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

/* Aktivní stránka (ta, na které zrovna jsem) */
.page-numbers.current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
    cursor: default;
}

/* Tlačítka Další a Předchozí - uděláme je trochu širší */
.page-numbers.next, 
.page-numbers.prev {
    padding-left: 20px;
    padding-right: 20px;
}

/* Tečky (...) když je hodně stránek */
.page-numbers.dots {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 0 5px;
    min-width: auto;
}
.page-numbers.dots:hover {
    transform: none;
    box-shadow: none;
    cursor: default;
}


/* --- 10. VÝBĚR REDAKCE A SEKCÍ --- */

.section-heading {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 25px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Speciální styl pro karty ve výběru redakce */
.featured-card {
    border: 2px solid #fbbf24; /* Zlatý rámeček */
    box-shadow: 0 10px 25px rgba(251, 191, 36, 0.15); /* Zlatavý stín */
}

.featured-card:hover {
    box-shadow: 0 15px 30px rgba(251, 191, 36, 0.25);
    transform: translateY(-8px) scale(1.02);
}

/* Odznak TOP v rohu obrázku */
.card-badge-top {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #fbbf24;
    color: #78350f;
    font-weight: 800;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 8px;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Odznak TOP v rohu obrázku - POSUNUTÝ DOPRAVA */
.card-badge-top {
    position: absolute;
    top: 15px;
    right: 15px; /* Změna z left na right */
    background: #fbbf24;
    color: #78350f;
    font-weight: 800;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 8px;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}