/*
Theme Name: Menice.sk Theme
Theme URI: https://menice.sk
Author: menice.sk
Author URI: https://menice.sk
Description: Odborný portál o meničoch napätia, solárnych invertoroch a frekvenčných meničoch. Custom téma optimalizovaná pre SEO, rýchlosť a čitateľnosť.
Version: 1.0
Requires at least: 6.3
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: menice-sk
*/

/* ===== CSS RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #1B5E20;
    --primary-light: #2E7D32;
    --primary-dark: #0D3B13;
    --secondary: #FF8F00;
    --secondary-light: #FFB300;
    --accent: #0D47A1;
    --accent-light: #1565C0;
    --bg-light: #F1F8E9;
    --bg-white: #FFFFFF;
    --bg-gray: #F5F5F5;
    --text-dark: #212121;
    --text-body: #424242;
    --text-gray: #757575;
    --text-light: #9E9E9E;
    --border: #E0E0E0;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-sm: 4px;
    --max-width: 1200px;
    --content-width: 800px;
    --sidebar-width: 340px;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-body);
    background: var(--bg-white);
    -webkit-font-smoothing: antialiased;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
    margin-top: 1.8em;
    margin-bottom: 0.6em;
}

h1 { font-size: 2.2rem; color: var(--primary); }
h2 { font-size: 1.6rem; color: var(--primary); border-bottom: 2px solid var(--bg-light); padding-bottom: 0.3em; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

.entry-content h1:first-child,
.entry-content h2:first-of-type { margin-top: 0; }

p {
    margin-bottom: 1.2em;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

strong, b { font-weight: 600; }

/* ===== LAYOUT ===== */
.site-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.content-area {
    display: flex;
    gap: 40px;
    padding: 40px 0;
}

.main-content {
    flex: 1;
    min-width: 0;
    max-width: var(--content-width);
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
}

@media (max-width: 960px) {
    .content-area {
        flex-direction: column;
        gap: 30px;
        padding: 20px 0;
    }
    .sidebar { width: 100%; }
    .main-content { max-width: 100%; }
}

/* ===== HEADER ===== */
.site-header {
    background: var(--primary);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.site-logo span {
    color: var(--secondary);
}

/* ===== NAVIGATION ===== */
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 4px;
}

.main-nav a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.main-nav a:hover,
.main-nav .current-menu-item a {
    background: rgba(255,255,255,0.15);
    color: white;
    text-decoration: none;
}

/* Dropdown */
.main-nav li { position: relative; }

.main-nav ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 240px;
    box-shadow: var(--shadow-hover);
    border-radius: var(--radius);
    padding: 8px 0;
    flex-direction: column;
    z-index: 100;
}

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

.main-nav ul ul a {
    color: var(--text-body);
    padding: 10px 20px;
    font-size: 0.88rem;
    border-radius: 0;
}

.main-nav ul ul a:hover {
    background: var(--bg-light);
    color: var(--primary);
}

/* Mobile hamburger */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

@media (max-width: 768px) {
    .menu-toggle { display: block; }

    .main-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        padding: 16px;
    }

    .main-nav.active { display: block; }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }

    .main-nav a {
        display: block;
        padding: 12px 16px;
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .main-nav ul ul {
        position: static;
        box-shadow: none;
        background: rgba(0,0,0,0.15);
        padding: 0;
    }

    .main-nav ul ul a { padding-left: 32px; }
}

/* ===== BREADCRUMBS ===== */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--text-gray);
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.breadcrumbs a { color: var(--accent); }
.breadcrumbs span { margin: 0 6px; }

/* ===== ENTRY CONTENT ===== */
.entry-content ul,
.entry-content ol {
    margin: 0 0 1.2em 1.5em;
}

.entry-content li {
    margin-bottom: 0.5em;
    line-height: 1.6;
}

.entry-content ul li::marker {
    color: var(--primary);
}

/* ===== TABLES ===== */
.entry-content table,
.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.92rem;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.entry-content table thead th,
.wp-block-table thead th {
    background: var(--primary);
    color: white;
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.entry-content table td,
.wp-block-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.entry-content table tbody tr:hover {
    background: var(--bg-light);
}

.entry-content table tbody tr:last-child td {
    border-bottom: none;
}

/* Responsive table */
@media (max-width: 640px) {
    .wp-block-table { overflow-x: auto; display: block; }
    .wp-block-table table { min-width: 500px; }
}

/* ===== FAQ / DETAILS ===== */
details {
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s;
}

details:hover {
    border-color: var(--primary-light);
}

details summary {
    padding: 16px 20px;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg-gray);
    color: var(--text-dark);
    font-size: 1rem;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

details summary::-webkit-details-marker { display: none; }

details summary::after {
    content: '+';
    font-size: 1.3rem;
    font-weight: 300;
    color: var(--primary);
    transition: transform 0.2s;
}

details[open] summary::after {
    content: '−';
}

details[open] summary {
    background: var(--primary);
    color: white;
    border-bottom: 1px solid var(--border);
}

details[open] summary::after { color: white; }

details p {
    padding: 16px 20px;
    margin: 0;
}

/* ===== BUTTONS / CTA ===== */
.wp-block-button__link,
.btn-primary {
    display: inline-block;
    background: var(--secondary);
    color: white !important;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: var(--radius);
    text-decoration: none !important;
    font-size: 0.95rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.wp-block-button__link:hover,
.btn-primary:hover {
    background: var(--secondary-light);
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

/* ===== SIDEBAR WIDGETS ===== */
.widget {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--bg-light);
}

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

.widget li {
    padding: 8px 0;
    border-bottom: 1px solid var(--bg-gray);
}

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

.widget a {
    color: var(--text-body);
    font-size: 0.92rem;
}

.widget a:hover { color: var(--primary); }

/* ===== TIP / CALLOUT BOX ===== */
.tip-box,
.callout {
    background: #FFF8E1;
    border-left: 4px solid var(--secondary);
    padding: 16px 20px;
    margin: 1.5em 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.95rem;
}

.tip-box strong { color: var(--secondary); }

.info-box {
    background: #E3F2FD;
    border-left: 4px solid var(--accent);
    padding: 16px 20px;
    margin: 1.5em 0;
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* ===== AFFILIATE BOX ===== */
.affiliate-box {
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 24px;
    margin: 2em 0;
    background: var(--bg-light);
    text-align: center;
}

.affiliate-box .product-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.affiliate-box .product-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 16px;
}

/* ===== FOOTER ===== */
.site-footer {
    background: var(--text-dark);
    color: rgba(255,255,255,0.7);
    padding: 48px 0 24px;
    margin-top: 60px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.footer-section h4 {
    color: white;
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1rem;
}

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

.footer-section li { margin-bottom: 8px; }

.footer-section a {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
}

.footer-section a:hover { color: var(--secondary); }

.footer-bottom {
    max-width: var(--max-width);
    margin: 32px auto 0;
    padding: 24px 20px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 0.85rem;
}

.footer-bottom a { color: var(--secondary); }

@media (max-width: 768px) {
    .footer-inner { grid-template-columns: 1fr; gap: 24px; }
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.35rem; }
}

/* ===== CALCULATOR FORM ===== */
.calc-form {
    background: var(--bg-light);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 24px;
    margin: 2em 0;
}

.calc-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-dark);
}

.calc-form input,
.calc-form select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    margin-bottom: 16px;
}

.calc-form input:focus,
.calc-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27,94,32,0.15);
}

.calc-result {
    background: var(--primary);
    color: white;
    padding: 16px 20px;
    border-radius: var(--radius);
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 16px;
}

/* ===== COMPARISON TABLE ===== */
.comparison-table td:last-child {
    text-align: center;
}

.comparison-table .rating {
    color: var(--secondary);
    font-weight: 700;
}

.comparison-table .btn-affiliate {
    display: inline-block;
    background: var(--secondary);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

/* ===== SCHEMA / STRUCTURED DATA HELPER ===== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== PRINT ===== */
@media print {
    .site-header, .site-footer, .sidebar, .breadcrumbs { display: none; }
    .main-content { max-width: 100%; }
    a { color: inherit; text-decoration: underline; }
}
