/*
Theme Name: FinPost
Theme URI: https://finpost.cz
Author: FinPost
Description: Čistý moderní finanční magazín
Version: 1.1
License: GNU General Public License v2 or later
Text Domain: finpost
*/

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

:root {
    --color-primary:   #0a0f1e;
    --color-accent:    #e8363d;
    --color-bg:        #f0f2f5;
    --color-white:     #ffffff;
    --color-text:      #1a1d23;
    --color-muted:     #6b7280;
    --color-border:    #e5e7eb;
    --font-main:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif:      'Playfair Display', Georgia, serif;
    --radius:          8px;
    --shadow:          0 1px 8px rgba(0,0,0,.07);
    --shadow-hover:    0 8px 28px rgba(0,0,0,.13);
    --container:       1200px;
    --tr:              .2s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-main); background: var(--color-bg); color: var(--color-text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
/* DŮLEŽITÉ: img height:auto jen pro volně plovoucí obrázky – override níže pro containery */
img { max-width: 100%; display: block; }
ul { list-style: none; }

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

/* ===== TOP BAR ===== */
.top-bar { background: #060a14; color: rgba(255,255,255,.55); font-size: .73rem; padding: 7px 0; }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; }
.top-bar a { color: rgba(255,255,255,.55); transition: color var(--tr); }
.top-bar a:hover { color: #fff; }
.top-bar-date { display: flex; align-items: center; gap: 6px; }

/* ===== HEADER ===== */
.site-header { background: var(--color-primary); padding: 16px 0; position: sticky; top: 0; z-index: 200; box-shadow: 0 2px 20px rgba(0,0,0,.3); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.site-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-icon { width: 38px; height: 38px; background: var(--color-accent); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1rem; color: #fff; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; }
.logo-name { font-size: 1.4rem; font-weight: 800; color: #fff; letter-spacing: -.5px; line-height: 1; }
.logo-tagline { font-size: .65rem; color: rgba(255,255,255,.4); letter-spacing: .8px; text-transform: uppercase; margin-top: 2px; }

/* ===== NAV ===== */
.main-nav { display: flex; }
.nav-menu { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.nav-menu li a { color: rgba(255,255,255,.75); font-size: .8rem; font-weight: 500; padding: 6px 10px; border-radius: 5px; transition: all var(--tr); white-space: nowrap; }
.nav-menu li a:hover, .nav-menu li.current-menu-item a { background: rgba(255,255,255,.1); color: #fff; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px; background: none; border: none; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: var(--tr); }

/* ===== BREAKING TICKER ===== */
.breaking-bar { background: var(--color-accent); color: #fff; font-size: .78rem; padding: 7px 0; overflow: hidden; }
.breaking-inner { display: flex; align-items: center; gap: 14px; }
.breaking-label { font-weight: 800; text-transform: uppercase; letter-spacing: .6px; white-space: nowrap; background: rgba(0,0,0,.18); padding: 2px 10px; border-radius: 3px; flex-shrink: 0; font-size: .7rem; }
.breaking-ticker { overflow: hidden; flex: 1; }
.breaking-ticker ul { display: flex; gap: 48px; animation: ticker 40s linear infinite; white-space: nowrap; width: max-content; }
.breaking-ticker li a { color: #fff; opacity: .92; }
.breaking-ticker li::before { content: '▸'; margin-right: 6px; opacity: .7; }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ===== HERO ===== */
.hero { margin: 24px 0; }
.hero-grid { display: grid; grid-template-columns: 1fr 360px; grid-template-rows: 260px 200px; gap: 6px; border-radius: 12px; overflow: hidden; }

/* Sdílené pro hero položky */
.hero-main,
.hero-side { position: relative; overflow: hidden; display: block; background: #1a1d23; }
.hero-main { grid-row: 1 / 3; }

/* KLÍČOVÁ OPRAVA: obrázky uvnitř hero musí být absolutně pozicovány */
.hero-main img,
.hero-side img {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    opacity: .72;
    transition: transform .5s ease, opacity .3s ease;
}
.hero-main:hover img, .hero-side:hover img { transform: scale(1.04); opacity: .8; }

.hero-content {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 24px;
    background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.4) 60%, transparent 100%);
    z-index: 2;
}
.hero-main .hero-content { padding: 32px; }

.cat-badge {
    display: inline-flex;
    align-items: center;
    background: var(--color-accent);
    color: #fff;
    font-size: .65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    padding: 3px 9px;
    border-radius: 3px;
    margin-bottom: 10px;
}
.hero-main .hero-title { font-family: var(--font-serif); font-size: 1.65rem; font-weight: 700; color: #fff; line-height: 1.28; margin-bottom: 10px; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.hero-side .hero-title { font-size: .95rem; font-weight: 700; color: #fff; line-height: 1.35; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.hero-meta { font-size: .72rem; color: rgba(255,255,255,.65); display: flex; gap: 14px; }

/* placeholder když není obrázek */
.hero-placeholder { position: absolute; inset: 0; background: linear-gradient(135deg, #1a1d23 0%, #2d3748 100%); }

/* ===== SECTION HEADER ===== */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--color-border); }
.section-title { font-size: .85rem; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ''; display: block; width: 4px; height: 16px; background: var(--color-accent); border-radius: 2px; flex-shrink: 0; }
.section-more { font-size: .78rem; color: var(--color-accent); font-weight: 700; display: flex; align-items: center; gap: 4px; transition: gap var(--tr); }
.section-more:hover { gap: 8px; }

/* ===== ARTICLE CARDS ===== */
.articles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.articles-grid-4 { grid-template-columns: repeat(4, 1fr); }
.articles-grid-2 { grid-template-columns: repeat(2, 1fr); }

.article-card { background: var(--color-white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: box-shadow var(--tr), transform var(--tr); display: flex; flex-direction: column; }
.article-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }

/* KLÍČOVÁ OPRAVA: card-image jako kontejner s fixed aspect ratio */
.card-image {
    position: relative;
    display: block;
    width: 100%;
    padding-top: 60%;   /* 5:3 aspect ratio */
    overflow: hidden;
    background: #d1d5db;
    flex-shrink: 0;
}
.card-image img {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    transition: transform .35s ease;
}
.article-card:hover .card-image img { transform: scale(1.05); }
.card-image .cat-badge { position: absolute; top: 10px; left: 10px; z-index: 2; margin-bottom: 0; }

.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-title { font-size: .93rem; font-weight: 700; line-height: 1.4; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a:hover { color: var(--color-accent); }
.card-excerpt { font-size: .8rem; color: var(--color-muted); line-height: 1.55; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.card-meta { display: flex; align-items: center; gap: 10px; font-size: .7rem; color: var(--color-muted); border-top: 1px solid var(--color-border); padding-top: 10px; margin-top: auto; flex-wrap: wrap; }
.card-meta .author { font-weight: 700; color: var(--color-text); }

/* ===== LIST ITEMS (sidebar) ===== */
.article-list { display: flex; flex-direction: column; gap: 14px; }
.article-list-item { display: flex; gap: 12px; align-items: flex-start; }

/* KLÍČOVÁ OPRAVA: list thumbnail jako kontejner */
.list-item-img {
    position: relative;
    width: 88px;
    height: 66px;
    flex-shrink: 0;
    border-radius: 5px;
    overflow: hidden;
    background: #d1d5db;
    display: block;
}
.list-item-img img {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}
.list-item-body { flex: 1; min-width: 0; }
.list-item-cat { font-size: .62rem; font-weight: 800; text-transform: uppercase; color: var(--color-accent); letter-spacing: .4px; margin-bottom: 3px; }
.list-item-title { font-size: .83rem; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 3px; }
.list-item-title a:hover { color: var(--color-accent); }
.list-item-date { font-size: .68rem; color: var(--color-muted); }

/* ===== AD SLOTS ===== */
.ad-slot { background: #f9fafb; border: 1px dashed #d1d5db; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: #9ca3af; font-size: .75rem; letter-spacing: .3px; }
.ad-slot-banner { height: 90px; margin: 20px 0; }

/* ===== MAIN LAYOUT ===== */
.main-layout { display: grid; grid-template-columns: 1fr 300px; gap: 28px; margin: 28px 0; align-items: start; }
.main-content { min-width: 0; }
.sidebar { min-width: 0; position: sticky; top: 76px; }
.content-section { margin-bottom: 34px; }

/* ===== SIDEBAR WIDGETS ===== */
.widget { background: var(--color-white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 20px; }
.widget-title { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--color-border); display: flex; align-items: center; gap: 8px; }
.widget-title::before { content: ''; display: block; width: 3px; height: 13px; background: var(--color-accent); border-radius: 2px; flex-shrink: 0; }

/* ===== CATEGORY COLORS ===== */
.cat-kryptomeny   { background: #6366f1 !important; }
.cat-investice    { background: #10b981 !important; }
.cat-svetova-ekonomika { background: #3b82f6 !important; }
.cat-evropska-ekonomika { background: #0ea5e9 !important; }
.cat-hypoteky     { background: #f59e0b !important; }
.cat-pojisteni    { background: #8b5cf6 !important; }
.cat-osobni-finance { background: #ec4899 !important; }
.cat-burza        { background: #14b8a6 !important; }
.cat-dane         { background: #ef4444 !important; }
.cat-podnikani    { background: #f97316 !important; }

/* ===== SINGLE ARTICLE ===== */
.single-hero { background: var(--color-primary); padding: 44px 0 0; }
.single-hero-inner { max-width: 860px; }
.single-category { display: inline-flex; align-items: center; gap: 6px; background: var(--color-accent); color: #fff; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; padding: 4px 12px; border-radius: 3px; margin-bottom: 16px; }
.single-title { font-family: var(--font-serif); font-size: 2.1rem; font-weight: 700; color: #fff; line-height: 1.24; margin-bottom: 16px; }
.single-lead { font-size: 1.05rem; color: rgba(255,255,255,.68); line-height: 1.65; margin-bottom: 18px; }
.single-meta-bar { display: flex; align-items: center; gap: 20px; font-size: .78rem; color: rgba(255,255,255,.5); padding: 14px 0; border-top: 1px solid rgba(255,255,255,.1); flex-wrap: wrap; }
.single-meta-bar .author-name { color: rgba(255,255,255,.88); font-weight: 700; }

/* featured image pod titulkem */
.single-featured-wrap {
    position: relative;
    width: 100%;
    padding-top: 42%;   /* 21:9 crop */
    overflow: hidden;
    border-radius: 10px 10px 0 0;
    margin-top: 28px;
    background: #1a1d23;
}
.single-featured-wrap img {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

.article-body { background: var(--color-white); padding: 36px 40px; border-radius: 0 0 10px 10px; box-shadow: var(--shadow); font-size: 1.02rem; line-height: 1.82; color: #2d3748; }
.article-body h2 { font-family: var(--font-serif); font-size: 1.45rem; font-weight: 700; margin: 34px 0 14px; color: var(--color-text); }
.article-body h3 { font-size: 1.1rem; font-weight: 700; margin: 26px 0 10px; }
.article-body p { margin-bottom: 18px; }
.article-body ul, .article-body ol { margin: 0 0 18px 24px; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 7px; }
.article-body blockquote { border-left: 4px solid var(--color-accent); padding: 16px 22px; margin: 26px 0; background: #fef9f9; font-style: italic; font-size: 1.08rem; color: #6b7280; border-radius: 0 6px 6px 0; }
.article-body a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 2px; }
.article-body img { border-radius: 8px; margin: 22px 0; width: 100%; height: auto !important; }
.article-body strong { color: var(--color-text); }

.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--color-border); }
.tag-item { background: var(--color-bg); border: 1px solid var(--color-border); padding: 4px 13px; border-radius: 100px; font-size: .76rem; color: var(--color-muted); transition: all var(--tr); }
.tag-item:hover { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }

/* ===== RELATED ===== */
.related-posts { margin: 32px 0; }

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: 5px; justify-content: center; margin: 36px 0; flex-wrap: wrap; }
.page-numbers { min-width: 38px; height: 38px; padding: 0 10px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); font-size: .83rem; font-weight: 600; border: 1px solid var(--color-border); background: var(--color-white); transition: all var(--tr); }
.page-numbers:hover, .page-numbers.current { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }

/* ===== FOOTER ===== */
.site-footer { background: #060a14; color: rgba(255,255,255,.6); margin-top: 52px; }
.footer-top { padding: 48px 0 32px; display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; border-bottom: 1px solid rgba(255,255,255,.07); }
.footer-brand p { font-size: .82rem; line-height: 1.65; margin-top: 14px; color: rgba(255,255,255,.45); }
.footer-col h4 { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; color: rgba(255,255,255,.85); margin-bottom: 14px; }
.footer-col ul { display: flex; flex-direction: column; gap: 9px; }
.footer-col ul li a { font-size: .82rem; color: rgba(255,255,255,.45); transition: color var(--tr); }
.footer-col ul li a:hover { color: #fff; }
.footer-bottom { padding: 16px 0; display: flex; justify-content: space-between; align-items: center; font-size: .75rem; color: rgba(255,255,255,.3); }
.footer-bottom a { color: rgba(255,255,255,.4); }

/* ===== ARCHIVE ===== */
.archive-header { background: var(--color-primary); padding: 36px 0; margin-bottom: 28px; }
.archive-title { font-size: 1.7rem; font-weight: 800; color: #fff; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.archive-count { font-size: .85rem; color: rgba(255,255,255,.4); font-weight: 400; }
.archive-desc { color: rgba(255,255,255,.55); margin-top: 8px; font-size: .92rem; line-height: 1.55; }

/* ===== NO THUMBNAIL ===== */
.no-thumb { background: linear-gradient(135deg, #1e2535 0%, #2d3748 100%); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.no-thumb::after { content: '₣'; font-size: 2rem; color: rgba(255,255,255,.1); font-weight: 900; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .articles-grid   { grid-template-columns: repeat(2, 1fr); }
    .articles-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-top      { grid-template-columns: 1fr 1fr; gap: 28px; }
    .sidebar         { position: static; }
}
@media (max-width: 768px) {
    .hero-grid       { grid-template-columns: 1fr; grid-template-rows: 280px 180px 180px; }
    .hero-main       { grid-row: auto; }
    .main-layout     { grid-template-columns: 1fr; }
    .nav-menu        { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--color-primary); padding: 12px; gap: 2px; z-index: 300; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
    .nav-menu.open   { display: flex; }
    .nav-toggle      { display: flex; }
    .main-nav        { position: relative; }
    .single-title    { font-size: 1.5rem; }
    .article-body    { padding: 22px; }
    .footer-top      { grid-template-columns: 1fr 1fr; gap: 24px; }
    .footer-bottom   { flex-direction: column; gap: 8px; text-align: center; }
    .single-featured-wrap { padding-top: 56%; border-radius: 6px 6px 0 0; }
}
@media (max-width: 520px) {
    .articles-grid   { grid-template-columns: 1fr; }
    .hero-main .hero-title { font-size: 1.25rem; }
    .footer-top      { grid-template-columns: 1fr; }
    .article-body    { padding: 18px; font-size: .95rem; }
}