/* Pevná hlavička a nabídka pro libovolně dlouhé položky. */
header { position: relative; z-index: 50; }
header .header-inner {
    height: 103px;
    min-height: 103px;
    padding: 12px 24px;
    flex-wrap: nowrap;
    gap: 18px;
    position: relative;
}
header .brand-section-group { flex: 0 1 auto; min-width: 0; }
header .brand-copy small {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.header-tools { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
header .primary-nav {
    flex-wrap: nowrap;
    order: 0;
    width: auto;
    border: 0;
    padding: 0;
    gap: 6px;
    overflow: visible;
}
header .primary-nav > a { white-space: nowrap; }
header .menu-toggle, header .theme-toggle {
    padding: 7px 9px;
    line-height: 1.4;
    font-size: 13px;
    color: var(--ink);
    border: 1px solid var(--line);
    background: var(--white);
}
header .theme-toggle { font-size: 20px; padding: 3px 8px; }
header .menu-toggle { display: none; }
header .menu-collapsed .menu-toggle { display: block; }
header .menu-collapsed .primary-nav {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    right: 16px;
    width: min(360px, calc(100vw - 32px));
    max-height: 70vh;
    overflow-y: auto;
    padding: 12px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 10px 30px #0002;
}
header .menu-collapsed.menu-open .primary-nav { display: flex; flex-direction: column; align-items: stretch; }
header .menu-collapsed .primary-nav a { white-space: normal; overflow-wrap: anywhere; }
.mobile-account-controls { display: none; }
header .account-user-actions .account-editor-link { color: #2563eb; }
.search button {
    background: var(--section-accent, #2563eb);
    border-color: var(--section-accent, #2563eb);
    color: var(--section-contrast, #fff);
    font-weight: 700;
}
.hero-top .section-label::before { background: var(--section-accent, #2563eb); }
/* Ořez je řízený výškou kontejneru, nikdy poměrem vloženého souboru. */
.article-grid .card .visual { height: 235px; }
.featured-grid .lead-card .visual { height: 355px; }
.featured-grid .card:not(.lead-card) .visual { height: 155px; }
.card .visual > img, .card .visual > .orb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.admin-body { --lime: #93c5fd; --paper: #f3f6fb; }
.admin-body .admin-nav { background: #172d50; color: #e2edff; }
.admin-body .admin-nav strong { color: #93c5fd; }
.admin-body #content :is(button, .button):where(:not(.text-button, .theme-toggle, .menu-toggle, .danger-button, .media-tile)) {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}
.admin-body .admin-nav a:hover { background: #dbeafe; color: #1e40af; }
.admin-body .badge { background: #e4efff; color: #1e40af; }
.admin-body :is(input[type=checkbox], input[type=radio]) { accent-color: #2563eb; }
.admin-body .comment-quote { background: #eef4fc; border-color: #9db9df; }
.admin-body .notice { background: #e4efff; border-color: #2563eb; }
.admin-body :is(.section-logo-preview, .default-section-row) { background: #f2f6fc; }
.admin-body :is(a, button, input, textarea, select):focus-visible { outline-color: #3b82f6; }
/* Výchozí tmavý vzhled lze přepnout a volba zůstává v tomto prohlížeči. */
html[data-theme=dark] {
    color-scheme: dark;
    --ink: #e5edf7;
    --paper: #111720;
    --white: #1a2432;
    --muted: #a8b6ca;
    --line: #344258;
    --lime: #8bb7ef;
}
html[data-theme=dark] body { background: var(--paper); color: var(--ink); }
html[data-theme=dark] :is(.admin-body, .panel, .admin-body .panel, .section-menu, .media-library, .cookie-banner, .cookie-dialog) {
    background: var(--white); color: var(--ink); border-color: var(--line);
}
html[data-theme=dark] .admin-body { --paper: #111720; }
html[data-theme=dark] .magazine-hero.without-images { background: #18283c; }
html[data-theme=dark] :is(input, textarea, select) {
    background: #111b29; color: var(--ink); border-color: #40506a;
}
html[data-theme=dark] :is(.section-menu a, .brand, .footer-links, .text-button, .site-footer .brand-copy) { color: var(--ink); }
html[data-theme=dark] .section-menu a:hover,
html[data-theme=dark] .section-menu a[aria-current] { background: #2b3d55; }
html[data-theme=dark] .partners-band { background: #172130; }
html[data-theme=dark] .site-footer { background: #0c121b; }
html[data-theme=dark] .partner-tile { background: #e9edf2; color: #182331; }
html[data-theme=dark] .account-avatar { background: #29466d; color: #dceaff; }
html[data-theme=dark] .account-user-actions .account-editor-link { color: #83b7ff; }
html[data-theme=dark] .admin-body :is(.admin-link, .admin-actions > a, .table-wrap a) { color: #90bcff; }
html[data-theme=dark] .admin-body :is(.comment-body, .section-logo-preview, .default-section-row) {
    background: #131e2d; border-color: var(--line); color: var(--ink);
}
html[data-theme=dark] .admin-tabs a { background: #1c2b40; border-color: var(--line); color: var(--ink); }
html[data-theme=dark] .admin-tabs a.active { background: #2358b5; border-color: #4f87e2; }
html[data-theme=dark] :is(.category-row-copy small, .muted) { color: var(--muted); }
html[data-theme=dark] .admin-body :is(.panel h2, .category-row, .admin-tabs) { border-color: var(--line); }
html[data-theme=dark] :is(.chips a, .badge) { background: #22334b; color: #d3e4fc; border-color: #435c7f; }
html[data-theme=dark] .chips a.selected { background: #2857a4; color: #fff; }
html[data-theme=dark] :is(.notice, .comment-quote, .prose blockquote) { background: #20344f; border-color: #679ce6; color: var(--ink); }
html[data-theme=dark] .media-grid .media-tile { background: #23334a; color: #e4edfa; border-color: #3c5272; }
html[data-theme=dark] .cookie-dialog::backdrop { background: #0009; }
html[data-theme=dark] th { background: #24344b; color: var(--ink); }
html[data-theme=dark] :is(td, th) { border-color: var(--line); }
html[data-theme=dark] button:where(:not(.text-button, .theme-toggle, .menu-toggle, .media-tile, .danger-button, .cookie-footer-button)) { background: #285bb5; border-color: #4a7bcd; color: #fff; }
html[data-theme=dark] .search button { background: var(--section-accent); border-color: var(--section-accent); color: var(--section-contrast); }
@media(max-width:650px) {
    header .header-inner { padding: 10px 12px; gap: 8px; }
    header .brand-section-group { flex: 0 1 auto; justify-content: flex-start; gap: 0; }
    header .brand { font-size: 22px; }
    header .brand-logo { width: 30px; height: 30px; }
    header .brand-copy small { display: none; }
    header .section-switch summary { padding: 6px; font-size: 18px; }
    header .account-user-info { display: none; }
    header .account-avatar { width: 32px; height: 32px; }
    header .account { margin: 0; }
    header .header-tools { gap: 6px; }
    header .mobile-account-controls { display: flex; border-top: 1px solid var(--line); padding-top: 8px; gap: 16px; }
    header .mobile-account-controls form { margin: 0; }
    header .account:not(.account-signed-in) a { font-size: 11px; }
    .article-grid .card .visual { height: 230px; }
    .featured-grid .lead-card .visual { height: 280px; }
    .featured-grid .card:not(.lead-card) .visual { height: 125px; }
}

header .primary-nav > a { color: var(--ink); }
header .primary-nav > a:hover { color: #fff; background: #1d4ed8; }
.admin-body .section-label::before { background: #3b82f6; }
.admin-body input, .admin-body textarea, .admin-body select { border-color: #b9cbe2; }
html[data-theme=dark] .eyebrow { color: #a7bbd5; }
html[data-theme=dark] .table-wrap { background: var(--white); }
html[data-theme=dark] .ad {
    background: repeating-linear-gradient(135deg, transparent, transparent 9px, #283548 9px, #283548 10px);
    border-color: #344258;
    color: var(--muted);
}
html[data-theme=dark] .site-footer .footer-author img[src*="chatgpt"] { filter: invert(1); }
html[data-theme=dark] .partner-tile small { color: #435a7b; }
html[data-theme=dark] .danger-button { background: #39232a; color: #ffb5b0; border-color: #81545b; }
html[data-theme=dark] .admin-body :is(input, textarea, select) { border-color: #40506a; }
@media(max-width:380px) {
    header .brand { font-size: 18px; }
    header .brand-logo { width: 26px; height: 26px; }
}
.admin-body .partners-band { background: #edf3fb; }
.admin-body .site-footer { background: #e2eaf6; }
.admin-body th { background: #e8f0fb; }
html[data-theme=dark] .admin-body .partners-band { background: #172130; }
html[data-theme=dark] .admin-body .site-footer { background: #0c121b; }
html[data-theme=dark] .admin-body th { background: #24344b; }
