/* =========================================================================
   Arc's — Dark Blog Theme
   Personal travel/lifestyle blog by Marek Páral
   ========================================================================= */

/* ===== VARIABLES ===== */
:root {
    --bg:              #111111;
    --bg-reading:      #262626;
    --bg-card:         #1a1a1a;
    --bg-card-hover:   #222222;
    --bg-nav:          #0a0a0a;
    --bg-sidebar:      #161616;
    --text:            #e0e0e0;
    --text-muted:      #888888;
    --text-heading:    #f0f0f0;
    --accent:          #6adb7f;
    --accent-hover:    #4ade80;
    --border:          #2a2a2a;
    --border-light:    #333333;
    --font-sans:       'Inter', 'Segoe UI', system-ui, sans-serif;
    --font-serif:      'Playfair Display', Georgia, serif;
    --radius:          4px;
    --shadow:          0 2px 12px rgba(0, 0, 0, 0.4);
    --transition:      0.2s ease;

    /* Legacy aliases — used by event/payment/admin components */
    --color-text:         var(--text);
    --color-text-muted:   var(--text-muted);
    --color-text-inverse: #ffffff;
    --color-primary:      var(--accent);
    --color-primary-dark: var(--accent-hover);
    --color-primary-light:rgba(106, 219, 127, 0.12);
    --color-accent:       var(--accent);
    --color-border:       var(--border);
    --color-bg-glass:     var(--bg-card);
    --color-bg-dark:      #0a0a0a;
    --color-bg-dark-alt:  #161616;
    --color-bg-start:     var(--bg);
    --color-bg-end:       var(--bg);
    --color-success:      #6adb7f;
    --color-success-bg:   #1a3a24;
    --color-error:        #f87171;
    --color-error-bg:     #3a1a1a;
    --color-warning:      #fbbf24;
    --color-warning-bg:   #3a2a10;
    --font-size-sm:  0.875rem;
    --font-size-md:  1rem;
    --font-size-lg:  1.125rem;
    --font-size-xl:  1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.75rem;
    --space-1:   0.25rem;
    --space-2:   0.5rem;
    --space-3:   0.75rem;
    --space-4:   1rem;
    --space-5:   1.25rem;
    --space-6:   1.5rem;
    --space-8:   2rem;
    --space-10:  2.5rem;
    --space-12:  3rem;
    --space-16:  4rem;
    --space-24:  6rem;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
    --max-width: 1200px;
    --max-width-narrow: 680px;
    --max-width-mid: 900px;
    --radius-sm: var(--radius);
    --radius-md: var(--radius);
    --radius-lg: var(--radius);
    --radius-xl: var(--radius);
    --radius-full: 999px;
    --line-height: 1.65;
    --transition-slow: 0.4s ease;
}

/* ===== LIGHT THEME ===== */
html.theme-light,
body.theme-light {
    --bg:              #f5f3ef;
    --bg-reading:      #ffffff;
    --bg-card:         #ffffff;
    --bg-card-hover:   #f0ede8;
    --bg-nav:          #e8e4dc;
    --bg-sidebar:      #eae6df;
    --text:            #2a2a2a;
    --text-muted:      #6b6b6b;
    --text-heading:    #1a1a1a;
    --accent:          #1a7a32;
    --accent-hover:    #15632a;
    --border:          #d5d0c8;
    --border-light:    #c8c2b8;
    --shadow:          0 2px 12px rgba(0, 0, 0, 0.1);
    --color-bg-dark:   #e8e4dc;
    --color-bg-dark-alt: #eae6df;
    --color-bg-glass:  #ffffff;
    --color-success-bg: #e6f5ea;
    --color-error-bg:  #fde8e8;
    --color-warning-bg: #fef3c7;
}
body.theme-light .post-sideheader__overlay {
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0.25) 0%,
        rgba(255,255,255,0.40) 35%,
        rgba(255,255,255,0.70) 70%,
        rgba(255,255,255,0.88) 100%
    );
}
body.theme-light .post-sideheader__title { color: #1a1a1a; text-shadow: 0 1px 4px rgba(255,255,255,0.5); }
body.theme-light .post-sideheader__perex { color: rgba(0,0,0,0.6); }
body.theme-light .post-side__date { color: rgba(0,0,0,0.45); }
body.theme-light .post-sideheader__menu-btn { background: rgba(255,255,255,0.72); color: rgba(0,0,0,0.7); border-left-color: rgba(0,0,0,0.12); }
body.theme-light .post-sideheader__menu-btn:hover { color: rgba(0,0,0,1); }
body.theme-light .post-side__prevnext { border-top-color: rgba(0,0,0,0.1); }
body.theme-light .post-side__nav-link { color: rgba(0,0,0,0.5); }
body.theme-light .article-content code { background: #f0ede8; color: var(--text); }

/* ===== MATRIX THEME ===== */
html.theme-matrix,
body.theme-matrix {
    --bg:              #0a0a0a;
    --bg-reading:      #1d1c1c;
    --bg-card:         #0f1a0f;
    --bg-card-hover:   #142014;
    --bg-nav:          #050805;
    --bg-sidebar:      #0a100a;
    --text:            #33ff33;
    --text-muted:      #1a991a;
    --text-heading:    #44ff44;
    --accent:          #00ff41;
    --accent-hover:    #66ff66;
    --border:          #1a3a1a;
    --border-light:    #224422;
    --shadow:          0 2px 12px rgba(0, 255, 65, 0.08);
    --color-bg-dark:   #050805;
    --color-bg-dark-alt: #0a100a;
    --color-bg-glass:  #0f1a0f;
    --font-sans:       'Courier New', 'Consolas', monospace;
}
body.theme-matrix .post-sideheader__title { color: #44ff44; text-shadow: 0 0 8px rgba(0,255,65,.4); }
body.theme-matrix .post-sideheader__perex { color: rgba(51,255,51,0.55); }
body.theme-matrix .post-side__date { color: rgba(51,255,51,0.4); }
body.theme-matrix .post-sideheader__menu-btn { background: rgba(0,20,0,0.8); color: #33ff33; border-left-color: rgba(0,255,65,0.15); }
body.theme-matrix .post-sideheader__overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.7) 50%, rgba(0,10,0,0.92) 100%);
}
body.theme-matrix .article-content code { background: #0a1a0a; color: #33ff33; }
body.theme-matrix .article-content a { color: #00ff41; }
body.theme-matrix .post-side__tag { color: #00ff41; border-color: rgba(0,255,65,0.3); }
body.theme-matrix .post-side__tag:hover { background: rgba(0,255,65,0.1); }

/* ===== THEME PICKER ===== */
.theme-picker { display: flex; align-items: center; gap: .5rem; padding: .5rem 0; font-size: .85rem; color: var(--text-muted); cursor: default; }
.theme-picker__select { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); padding: .25rem .5rem; font-size: .8rem; cursor: pointer; }

/* ===== RESET ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

/* ===== BODY ===== */
body {
    font-family: var(--font-sans);
    font-size: var(--font-size-md);
    line-height: var(--line-height);
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

img, picture, video {
    max-width: 100%;
    display: block;
}

img[loading="lazy"] {
    background: #1e1e1e;
    min-height: 4px;
}
img[loading="lazy"].loaded { background: none; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4, h5 {
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-heading);
}

h1 { font-size: var(--font-size-4xl); margin-bottom: var(--space-6); }
h2 { font-size: var(--font-size-3xl); margin-bottom: var(--space-4); }
h3 { font-size: var(--font-size-xl);  margin-bottom: var(--space-3); }

p {
    margin-bottom: var(--space-4);
    color: var(--text-muted);
}

ul, ol {
    padding-left: var(--space-6);
    margin-bottom: var(--space-4);
    color: var(--text-muted);
}

/* ===== LAYOUT ===== */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container--narrow { max-width: var(--max-width-narrow); }
.container--mid    { max-width: var(--max-width-mid); }
.container--wide   { max-width: 1100px; }

.main-content {
    padding-top: 0;
    min-height: 60vh;
    padding-bottom: var(--space-12);
}

.main-content--fullwidth {
    padding-top: 0;
    padding-bottom: 0;
}

.main-content--post {
    padding-top: 0;
    padding-bottom: 0;
}

/* ===== NAVIGATION ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    pointer-events: none; /* let clicks pass through to content */
}

.nav__bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    pointer-events: auto;
}

.nav__logo-fab {
    width: 53px;
    height: 53px;
    border-radius: var(--radius);
    background: url('/assets/images/arcs-logo.jpeg') center center / cover no-repeat;
    color: transparent;
    display: block;
    text-decoration: none;
    flex-shrink: 0;
    transition: transform var(--transition), opacity var(--transition);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.nav__logo-fab:hover {
    transform: scale(1.06);
    opacity: 0.9;
}

.nav__menu-btn,
#sidebar-btn {
    background: rgba(10, 10, 10, 0.50);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 0;
    color: rgba(255, 255, 255, 0.75);
    width: 50px;
    height: 36px;
    margin-left: 0px;
    padding: 0;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background var(--transition), border-color var(--transition), color var(--transition), width var(--transition);
    border-radius: 0;
    line-height: 30px;
    text-align: right;
    padding: 3px 10px 3px;
    overflow: hidden;
    white-space: nowrap;
    font-family: var(--font-sans);
}
.nav__menu-btn:hover,
#sidebar-btn:hover {
    background: rgba(20, 20, 20, 0.92);
    border-left: 0;
    color: var(--accent);
    width: 55px;
    padding: 3px 10px 3px;
    line-height: 30px;
}

/* ===== STATIC HERO (Arc's blog homepage) ===== */
.hero-static {
    height: 85vh;
    min-height: 400px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    margin-top: 60px;
}

.hero-static__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.65);
}

.hero-static__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.55) 60%, rgba(0, 0, 0, 0.88) 100%);
}

.hero-static__content {
    position: relative;
    z-index: 1;
    color: white;
}

.hero-static__title {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    color: white;
    margin: 0 0 0.5rem;
    line-height: 1;
}

.hero-static__tagline {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
}

/* ===== THREE.JS HERO (konstelace compat) ===== */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #1a1a2e;
}

.hero canvas {
    display: block;
    position: absolute;
    inset: 0;
}

.hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5rem 2rem 3.5rem;
    pointer-events: none;
    text-align: center;
}

.hero__top {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero__bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.hero__title {
    font-size: clamp(2rem, 5vw, 3.6rem);
    font-weight: 800;
    margin: 0 0 .75rem;
    line-height: 1.15;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0,0,0,.95), 0 0 30px rgba(0,0,0,.5);
}

.hero__subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: rgba(200, 185, 255, 0.9);
    margin: 0 0 .4rem;
}

.hero__title--rotating {
    position: relative;
    min-height: 1.2em;
    display: block;
}

.hero__title-item {
    display: block;
    opacity: 0;
    position: absolute;
    left: 0;
    right: 0;
    transition: opacity .6s ease;
    pointer-events: none;
}

.hero__title-item--active {
    opacity: 1;
    position: relative;
    pointer-events: auto;
}

.hero__actions {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
    pointer-events: auto;
}

/* ===== SIDEBAR (sliding panel) ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding: 80px 1.5rem 2rem;
}

.sidebar.is-open {
    transform: translateX(0);
}

#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 199;
}

#sidebar-overlay.is-visible {
    display: block;
}

.sidebar-inner h3 {
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 0.75rem;
}

.sidebar-search input,
.sidebar-search .form-input {
    width: 100%;
    background: #222222;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    outline: none;
}
.sidebar-search input:focus { border-color: var(--accent); }

.sidebar-tags {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: baseline;
}

.tag-cloud-link {
    color: var(--text-muted);
    text-decoration: none;
    line-height: 1.8;
    transition: color 0.15s;
}
.tag-cloud-link:hover { color: var(--accent); }
.tag-cloud-link--active { color: var(--accent); }

.sidebar-contact {
    margin-top: 2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.sidebar-contact p { margin-bottom: 0.35rem; color: var(--text-muted); }
.sidebar-contact a { color: var(--text-muted); text-decoration: none; }
.sidebar-contact a:hover { color: var(--accent); }

/* ===== BLOG LAYOUT ===== */
.blog-layout {
    display: flex;
    gap: 0;
}

.blog-main {
    flex: 1;
    padding-top: 2rem;
}

.blog-container h1 {
    margin-bottom: 1.5rem;
}

/* ===== BLOG HEADER + SORT ===== */
.blog-main__header { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.blog-main__header h1 { margin: 0; }
.blog-sort { display: flex; gap: .25rem; margin-left: auto; }
.blog-sort__btn { font-size: .75rem; padding: .2rem .55rem; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-muted); text-decoration: none; transition: all .12s; }
.blog-sort__btn:hover { color: var(--accent); border-color: var(--accent); }
.blog-sort__btn.active { background: var(--accent); color: #000; border-color: var(--accent); }

/* ===== POST GRID ===== */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .post-grid { grid-template-columns: 1fr; }
}

/* ===== POST CARD ===== */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.post-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.post-card__thumb {
    display: block;
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.post-card__thumb-placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 4/3;
    background: #1e1e1e;
}

.post-card__body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-card__tag {
    font-size: 0.7rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-right: 0.5rem;
    display: inline-block;
    margin-bottom: 0.4rem;
}

.post-card__title {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
}

.post-card__title a {
    color: var(--text-heading);
    text-decoration: none;
}
.post-card__title a:hover { color: var(--accent); }

.post-card__excerpt {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 auto;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.post-card__date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.post-card__read {
    font-size: 0.75rem;
    color: var(--accent);
    text-decoration: none;
}
.post-card__read:hover { text-decoration: underline; }

/* Used in renderLatestPosts */
.post-card__link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    margin-top: auto;
}
.post-card__link:hover { text-decoration: underline; }

/* ===== POST DETAIL ===== */
.post-header {
    padding: 2rem 0 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.post-header__title {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    color: var(--text-heading);
    margin: 0 0 0.5rem;
}

.post-header__date {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.5rem;
}

.post-header__perex {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

.post-header__image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-top: 1.5rem;
    display: block;
}

/* ===== ARTICLE CONTENT ===== */
.article-content {
    max-width: 740px;
    margin: 0 auto;
    line-height: 1.8;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5 {
    color: var(--text-heading);
    margin-top: 2rem;
}

.article-content a { color: var(--accent); }
.article-content a:hover { color: var(--accent-hover); text-decoration: underline; }

.article-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    color: var(--text-muted);
    margin: 1.5rem 0;
    font-style: italic;
}

.article-content img {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 1rem 0;
}

.article-content code {
    background: #222222;
    padding: 0.1em 0.3em;
    border-radius: 2px;
    font-size: 0.9em;
    color: var(--text);
}

.article-content pre {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1rem 0;
}

.article-content pre code {
    background: none;
    padding: 0;
}

/* ===== POST LAYOUT (arcs.cz style: sticky left sideheader + scrollable right content) ===== */
.post-layout {
    display: grid;
    grid-template-columns: min(400px, 38vw) 1fr;
    min-height: 100vh;
}

.post-sideheader {
    position: sticky;
    top: 0;
    height: 100vh;
    max-width: 400px;
    background: #1a1a1a no-repeat center center / cover;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.post-sideheader__overlay {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.25rem 1.5rem 1.5rem;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.45) 0%,
        rgba(0, 0, 0, 0.55) 35%,
        rgba(0, 0, 0, 0.78) 70%,
        rgba(0, 0, 0, 0.92) 100%
    );
}

/* Topbar = logo + hamburger jako jedna vizuální jednotka, fixed nad levým panelem */
.post-sideheader__topbar {
    display: flex;
    align-items: stretch;
    gap: 0;
    width: fit-content;
    border-radius: var(--radius);
    position: fixed;
    top: 2rem;
    left: 1.5rem;
    z-index: 210;
}
/* Skrýt topbar když je sidebar skrytý (post-logo-fixed přebírá roli) */
.post-layout.side-hidden .post-sideheader__topbar { display: none; }

.post-sideheader__logo {
    width: 64px;
    height: 64px;
    border-radius: var(--radius) 0 0 var(--radius);
    background: url('/assets/images/arcs-logo.jpeg') center center / cover no-repeat;
    box-shadow: 0 3px 14px rgba(0,0,0,.60);
    color: transparent;
    display: block;
    text-decoration: none;
    flex-shrink: 0;
}
.post-sideheader__logo:hover { opacity: 1; }

/* Logo vždy viditelné — fixed, mimo sideheader, pouze při side-hidden */
.post-logo-fixed {
    display: none;
    position: fixed;
    left: 0.6rem;
    top: 0.6rem;
    z-index: 300;
}
.post-layout.side-hidden .post-logo-fixed {
    display: block;
}

/* Encyclopedia edit FAB */
.enc-edit-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 5rem; /* místo pro eye tab */
    z-index: 500;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .4rem .8rem;
    font-size: .8rem;
    color: var(--accent);
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0,0,0,.35);
    transition: box-shadow .15s, color .15s;
}
.enc-edit-fab:hover { color: var(--accent-hover); box-shadow: 0 3px 16px rgba(0,0,0,.5); }

/* Encyclopedia entry nav bar */
.enc-nav { display: flex; align-items: center; gap: .5rem; padding: .75rem 0 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.enc-nav__link { color: var(--accent); text-decoration: none; font-size: .85rem; font-weight: 500; }
.enc-nav__link:hover { text-decoration: underline; }
.enc-nav__sep { color: var(--text-muted); font-size: .75rem; }
.enc-nav__current { color: var(--text-heading); font-size: .85rem; font-weight: 600; }
.enc-nav__search { margin-left: auto; position: relative; }
.enc-nav__input { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); padding: .35rem .65rem; font-size: .8rem; width: 200px; transition: border-color .15s; }
.enc-nav__input::placeholder { color: var(--text-muted); }
.enc-nav__input:focus { outline: none; border-color: var(--accent); }
.enc-suggest { position: absolute; top: 100%; right: 0; width: 280px; max-height: 360px; overflow-y: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 100; margin-top: 2px; }
.enc-suggest__item { display: block; padding: .45rem .75rem; color: var(--text); text-decoration: none; font-size: .82rem; border-bottom: 1px solid var(--border); }
.enc-suggest__item:last-child { border-bottom: none; }
.enc-suggest__item:hover { background: var(--bg-card-hover); color: var(--accent); }
@media (max-width: 600px) {
    .enc-nav__search { margin-left: 0; width: 100%; }
    .enc-nav__input { width: 100%; }
    .enc-suggest { width: 100%; }
}

.post-sideheader__menu-btn {
    background: rgba(0, 0, 0, 0.72);
    border: none;
    margin-top: 13px;
    margin-left: 0px;
    border-left: 1px solid rgba(255,255,255,0.12);
    color: rgba(255, 255, 255, 0.85);
    padding: 0 0.7rem;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: auto;
    align-self: stretch;
}
.post-sideheader__menu-btn:hover { color: rgba(255,255,255,1); }

.post-sideheader__content {
    padding: 1.5rem 0 1rem;
    margin-top: auto;
}

.post-sideheader__title {
    font-family: var(--font-serif);
    font-size: clamp(1.25rem, 2.2vw, 1.85rem);
    color: #ffffff;
    line-height: 1.25;
    margin: 0 0 0.75rem;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.post-sideheader__perex {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.65;
    margin: 0 0 0.75rem;
}

.post-sideheader__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.post-side__date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.post-side__tag {
    font-size: 0.7rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
    padding: 0.1rem 0.4rem;
    border: 1px solid rgba(106, 219, 127, 0.35);
    border-radius: 2px;
    transition: background var(--transition), border-color var(--transition);
}
.post-side__tag:hover {
    background: rgba(106, 219, 127, 0.12);
    border-color: var(--accent);
}

.post-side__prevnext {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
}

.post-side__nav-link {
    flex: 1 1 50%;
    min-width: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    line-height: 1.4;
    transition: color var(--transition);
    overflow-wrap: break-word;
}
.post-side__nav-link:hover { color: var(--accent); }
.post-side__nav-link--next { text-align: right; }

.post-content-area {
    padding: 3.5rem 3.5rem 5rem;
    min-height: 100vh;
    background: var(--bg-reading);
    /* Rezervuj místo pro pravý panel (300px) + gap */
    padding-right: calc(300px + 2.5rem);
}

.post-content-area .article-content {
    max-width: 660px;
    margin: 0;
}

.post-content-footer {
    max-width: 660px;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 860px) {
    .post-layout {
        grid-template-columns: 280px 1fr;
    }
    /* Na tabletách panel je bottom sheet, nepotřebujeme padding-right */
    .post-content-area {
        padding-right: 3.5rem;
    }
    .post-content-area .article-content,
    .post-content-footer { max-width: 700px; margin: 0 auto; }
}

@media (max-width: 640px) {
    .post-layout {
        grid-template-columns: 200px 1fr;
    }

    .post-content-area {
        padding: 2rem 1rem 3rem;
    }

    .post-sideheader__title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .post-layout {
        grid-template-columns: 160px 1fr;
    }

    .post-sideheader__perex {
        display: none;
    }
}

/* ===== SIDEBAR NAV LINKS ===== */
.sidebar-nav {
    margin-bottom: 1.5rem;
    margin-top: 3em;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-nav h3 {
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 0.75rem;
}

.sidebar-nav-link {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
    transition: color var(--transition);
}
.sidebar-nav-link:last-child { border-bottom: none; }
.sidebar-nav-link:hover { color: var(--accent); }

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-nav);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.footer nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.footer nav a {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
}
.footer nav a:hover { color: var(--accent); }

/* ===== FLASH ===== */
.flash {
    position: fixed;
    top: 70px;
    right: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    z-index: 1000;
    font-size: 0.9rem;
}

.flash--success {
    background: #1a3a24;
    color: #6adb7f;
    border: 1px solid #2a5a34;
}

.flash--error {
    background: #3a1a1a;
    color: #f87171;
    border: 1px solid #5a2a2a;
}

.flash--info {
    background: #1a2a3a;
    color: #93c5fd;
    border: 1px solid #2a4a6a;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
    font-family: var(--font-sans);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
    background: var(--accent);
    color: #111111;
    font-weight: 600;
}
.btn--primary:hover {
    background: var(--accent-hover);
    color: #111111;
}

.btn--secondary-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-muted);
}
.btn--secondary-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn--secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn--secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-heading);
}

.btn--dark {
    background: var(--bg-nav);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn--dark:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn--danger {
    background: #b91c1c;
    color: #fff;
}
.btn--danger:hover { background: #991b1b; }

.btn--sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-6);
    transition: box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
    box-shadow: var(--shadow);
    border-color: var(--border-light);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.form-input {
    display: block;
    width: 100%;
    background: #1e1e1e;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    box-sizing: border-box;
    transition: border-color var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
}

textarea.form-input {
    resize: vertical;
    min-height: 150px;
    line-height: 1.6;
}

/* ===== ADMIN EDIT BAR ===== */
.admin-edit-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: #1a1a2a;
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
}

.admin-edit-bar__label {
    color: #666666;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.admin-edit-bar__link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.admin-edit-bar__link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ===== LATEST POSTS (homepage) ===== */
.latest-posts {
    padding: 3rem 0;
}

.latest-posts h2,
.latest-posts .section-title {
    font-family: var(--font-serif);
    color: var(--text-heading);
    margin-bottom: 1.5rem;
}

.latest-posts__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: var(--space-8);
}

.latest-posts__more { text-align: center; }

@media (max-width: 768px) {
    .latest-posts__grid { grid-template-columns: 1fr; }
}

/* ===== SEARCH ===== */
.search-box {
    max-width: 600px;
    margin: 2rem auto;
}

.search-box__input {
    font-size: var(--font-size-lg);
    padding: var(--space-4);
}

.search-results {
    margin-top: 2rem;
    display: grid;
    gap: 0;
}

.search-result-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.search-result-item a {
    color: var(--accent);
    font-size: 1.05rem;
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.search-result-item p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

/* Legacy search classes */
.search-result {
    padding: var(--space-4);
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: border-color var(--transition);
    margin-bottom: 0.75rem;
    border-radius: var(--radius);
}
.search-result:hover { border-color: var(--accent); }

.search-result__title {
    font-weight: 700;
    color: var(--text-heading);
    display: block;
    margin-bottom: var(--space-1);
    font-size: var(--font-size-lg);
}
.search-result__title:hover { color: var(--accent); }
.search-result__excerpt { font-size: var(--font-size-sm); color: var(--text-muted); }

/* ===== NOTICES ===== */
.notice {
    padding: var(--space-4) var(--space-6);
    margin: var(--space-6) 0;
    border-left: 4px solid;
    background: var(--bg-card);
    border-radius: var(--radius);
}

.notice--warning {
    border-left-color: var(--color-warning);
    color: var(--text);
}
.notice--warning::before {
    content: "Upozornění";
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--color-warning);
    margin-bottom: var(--space-1);
}

/* ===== EVENTS (kept for konstelace compat) ===== */
.event-list {
    display: grid;
    gap: var(--space-6);
}

@media (min-width: 640px) {
    .event-list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

.event-card__thumb {
    display: block;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
    margin: calc(-1 * var(--space-6)) calc(-1 * var(--space-6)) var(--space-4);
    aspect-ratio: 16/7;
}

.event-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
    display: block;
}

.event-card:hover .event-card__thumb img { transform: scale(1.03); }

.event-card__meta {
    display: flex;
    gap: var(--space-4);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--space-2);
}

.event-card__title a { color: var(--text-heading); text-decoration: none; }
.event-card__title a:hover { color: var(--accent); }

.event-card__price {
    font-weight: 800;
    color: var(--accent);
    margin: var(--space-3) 0;
    font-size: var(--font-size-lg);
}

.event-detail__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-6);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-8);
    padding: var(--space-6);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.event-register {
    margin-top: var(--space-8);
    max-width: 500px;
}

/* ===== UPCOMING EVENTS (homepage compact cards) ===== */
.upcoming-events {
    padding: var(--space-12) 0;
}

.upcoming-events__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: var(--space-8);
}

.ev-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, border-color .2s, transform .2s;
}
.ev-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.ev-card__thumb {
    display: block;
    aspect-ratio: 16/7;
    overflow: hidden;
    background: #1e1e1e;
}
.ev-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
    display: block;
}
.ev-card:hover .ev-card__thumb img { transform: scale(1.03); }

.ev-card__body {
    padding: .85rem 1rem .5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.ev-card__top {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.ev-card__date {
    font-size: .75rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: capitalize;
}

.ev-badge {
    font-size: .65rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    padding: .1rem .5rem;
    white-space: nowrap;
}
.ev-badge--full { background: var(--color-error-bg);   color: var(--color-error); }
.ev-badge--few  { background: var(--color-warning-bg); color: var(--color-warning); }

.ev-card__title {
    font-size: .9rem;
    line-height: 1.35;
    margin: 0;
    font-weight: 700;
}
.ev-card__title a {
    color: var(--text-heading);
    text-decoration: none;
}
.ev-card__title a:hover { color: var(--accent); }

.ev-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .75rem;
    margin-top: .1rem;
}
.ev-card__meta-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: .75rem;
    color: var(--text-muted);
}

.ev-card__action {
    padding: .6rem 1rem;
    border-top: 1px solid var(--border);
    background: #161616;
    display: flex;
    justify-content: flex-end;
}

.upcoming-events__more { text-align: center; }

@media (max-width: 860px) {
    .upcoming-events__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
    .upcoming-events__grid { grid-template-columns: 1fr; }
}

/* ===== SECTION TITLE ===== */
.section-title {
    text-align: center;
    margin-bottom: var(--space-8);
    font-size: 1.75rem;
    color: var(--text-heading);
}

/* ===== PAYMENT QR ===== */
.payment-qr {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
.payment-qr__item {
    flex: 1 1 220px;
    text-align: center;
}
.payment-qr__item h3 {
    margin: 0 0 .4rem;
    font-size: 1rem;
    color: var(--text-heading);
}
.payment-qr__note {
    font-size: .8rem;
    color: var(--text-muted);
    margin: 0 0 .75rem;
}
.payment-qr__item svg {
    width: 100%;
    max-width: 240px;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
}

/* ===== 404 ===== */
.error-404 {
    padding: var(--space-16) 0;
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.error-404__content {
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
}

.error-404__title {
    font-size: clamp(5rem, 15vw, 9rem);
    font-weight: 800;
    line-height: 1;
    margin: 0 0 .25rem;
    color: var(--accent);
}

.error-404__subtitle {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 var(--space-4);
    color: var(--text-heading);
}

.error-404__text {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: var(--space-8);
}

.error-404__actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-8);
}

.error-404__footer p {
    font-size: .875rem;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}

.error-404__grid {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
    font-size: .875rem;
}

.error-404__grid a { color: var(--accent); text-decoration: none; }
.error-404__grid a:hover { text-decoration: underline; }

/* ===== ADMIN ===== */
body {
    /* Admin pages use their own HTML but inherit bg */
}

.admin-nav {
    background: var(--bg-nav);
    padding: var(--space-4) 0;
    margin-bottom: var(--space-8);
    border-bottom: 2px solid var(--accent);
}

.admin-nav .container {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    flex-wrap: wrap;
}

.admin-nav a {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
}
.admin-nav a:hover,
.admin-nav a.active { color: var(--accent); }

.admin-nav__title {
    color: var(--accent);
    font-weight: 800;
    font-size: var(--font-size-lg);
    margin-right: var(--space-4);
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.admin-login {
    max-width: 400px;
    margin: var(--space-16) auto;
    padding: var(--space-8);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
}

.admin-login h1 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-6);
    text-align: center;
    color: var(--text-heading);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
    margin-top: var(--space-4);
    background: var(--bg-card);
}

.admin-table th, .admin-table td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
    text-align: left;
    color: var(--text);
}

.admin-table th {
    background: #1e1e1e;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-table tr:hover td { background: #1e1e1e; }

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.admin-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: var(--space-6);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
}

.admin-stat__value {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1;
    margin-bottom: var(--space-2);
}

.admin-stat__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-2);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid currentColor;
    border-radius: var(--radius);
}

.status-badge--ceka_na_platbu { color: var(--color-warning); background: var(--color-warning-bg); }
.status-badge--zaplaceno      { color: var(--color-success); background: var(--color-success-bg); }
.status-badge--storno         { color: var(--color-error);   background: var(--color-error-bg); }

/* ===== GALLERY ===== */
.gallery-section {
    padding: var(--space-16) 0;
    background: var(--bg);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
}

.gallery-item {
    position: relative;
    height: 300px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.3));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-6);
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-item:hover img { transform: scale(1.1); }

.gallery-overlay h3 {
    color: white;
    margin-bottom: var(--space-1);
    font-size: var(--font-size-lg);
}

.gallery-overlay p {
    font-size: var(--font-size-sm);
    margin: 0;
    line-height: 1.4;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .gallery-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    }
}

/* ===== INTRO / ABOUT SECTIONS ===== */
.intro-section,
.section-about {
    padding: var(--space-16) 0;
}

.intro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-10);
    margin-bottom: var(--space-10);
}

.intro-col h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: var(--space-4);
    color: var(--accent);
}

.intro-col p {
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: var(--space-3);
}

.intro-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.intro-list li {
    color: var(--text-muted);
    line-height: 1.7;
    padding: .4rem 0 .4rem 1.5rem;
    position: relative;
}

.intro-list li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: .7rem;
    top: .6rem;
}

.intro-how {
    border-top: 1px solid var(--border);
    padding-top: var(--space-8);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-6);
    align-items: start;
}

.intro-how h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
    margin: 0;
}

.intro-how p {
    color: var(--text-muted);
    line-height: 1.75;
    margin: 0;
}

@media (max-width: 768px) {
    .intro-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    .intro-how {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
}

.text-accent { color: var(--accent); }

.content-text p {
    color: var(--text-muted);
    line-height: 1.8;
    max-width: 72ch;
    margin-bottom: var(--space-6);
}

.link-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-6);
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.link-list li {
    padding-left: 1.25rem;
    position: relative;
    color: var(--text-muted);
    line-height: 1.65;
    font-size: .95rem;
}

.link-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

.link-list a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.link-list a:hover { text-decoration-thickness: 2px; }

/* ===== BENEFITS STRIP (konstelace compat) ===== */
.benefits-strip {
    background: #161616;
    padding: var(--space-12) 0;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.25rem;
}

.benefit-item {
    background: #1e1e1e;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .75rem;
    transition: transform .3s ease, border-color .3s ease;
}
.benefit-item:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}
.benefit-item a { display: contents; }

.benefit-item h3 {
    color: var(--text-heading);
    font-size: 1rem;
    margin: 0;
    font-weight: 600;
}
.benefit-item p {
    color: var(--text-muted);
    font-size: .85rem;
    margin: 0;
}

@media (max-width: 900px) {
    .benefits-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
    .benefits-grid { grid-template-columns: repeat(2, 1fr); }
    .benefit-item { padding: 1.5rem .75rem; }
}

/* ===== UTILITY ===== */
.text-muted      { color: var(--text-muted); }
.text-sm         { font-size: var(--font-size-sm); }
.mt-4            { margin-top: var(--space-4); }
.mt-8            { margin-top: var(--space-8); }
.mb-4            { margin-bottom: var(--space-4); }
.mb-8            { margin-bottom: var(--space-8); }
.flex            { display: flex; }
.flex-wrap       { flex-wrap: wrap; }
.gap-4           { gap: var(--space-4); }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full          { width: 100%; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .main-content {
        padding-bottom: var(--space-8);
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
}

/* =====================================================================
   ARC PANEL — dual-panel reference system
   ===================================================================== */

/* ---- Arc-ref links in content ---- */
a.arc-ref {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent);
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
}
a.arc-ref:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--accent-hover);
}
a.arc-ref--active {
    color: var(--accent-hover);
    border-bottom-color: var(--accent-hover);
    background: rgba(106,219,127,0.08);
    border-radius: 2px;
    padding: 0 2px;
}

/* ---- Eye tab — plovoucí ouško mimo panel (stejná výška jako sekce v panelu) ---- */
#arc-eye-tab {
    position: fixed;
    right: 0;
    top: 20px;
    width: 80px;
    height: 80px;
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1089;
    transition: opacity .2s;
    overflow: hidden;
}
#arc-eye-tab .arc-panel-eye__icon { width: 70px; height: 70px; }
#arc-eye-tab:hover { opacity: 0.9; }
#arc-eye-tab.hidden { opacity: 0; pointer-events: none; }

/* ---- Eye sekce uvnitř panelu — stejná výška jako tab (150px) ---- */
#arc-panel-eye {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .75rem;
    padding: 1.25rem .75rem;
    height: 100px;
    box-sizing: border-box;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    background: rgba(0,0,0,.18);
    cursor: pointer;
    transition: background var(--transition);
}
#arc-panel-eye:hover { background: rgba(0,0,0,.26); }
.arc-panel-eye__icon { flex-shrink: 0; width: 70px; height: 70px; display: flex; align-items: center; justify-content: center; }
.arc-eye-info-btn { position: absolute; top: .4rem; right: .5rem; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--text-muted); font-size: .65rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color .15s, border-color .15s; line-height: 1; padding: 0; }
.arc-eye-info-btn:hover { color: var(--accent); border-color: var(--accent); }
#arc-panel-eye { position: relative; }
.arc-eye-info-box { max-height: 300px; overflow-y: auto; padding: .75rem 1rem; border-bottom: 1px solid var(--border); font-size: .8rem; line-height: 1.6; color: var(--text); background: var(--bg-card); }
.arc-eye-info-box h2, .arc-eye-info-box h3 { font-size: .85rem; color: var(--text-heading); margin: .75rem 0 .3rem; }
.arc-eye-info-box h2:first-child, .arc-eye-info-box h3:first-child { margin-top: 0; }
.arc-eye-info-box ul { padding-left: 1.2rem; margin: .3rem 0; }
.arc-eye-info-box li { margin: .2rem 0; }
.arc-eye-info-box strong { color: var(--accent); }

/* ---- Panel — plně skrytý když zavřený ---- */
#arc-panel {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    width: 300px;
    min-width: 220px;
    max-width: 430px;
    z-index: 1090;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1), box-shadow .28s;
    overflow: hidden;
}
#arc-panel.open {
    transform: translateX(0);
    box-shadow: -4px 0 24px rgba(0,0,0,.45);
}


/* ---- Panel left-edge resize handle (desktop) ---- */
.arc-panel-resize {
    position: absolute;
    left: -3px;
    top: 0;
    width: 6px;
    height: 100%;
    cursor: ew-resize;
    z-index: 10;
}
.arc-panel-resize:hover { background: rgba(106,219,127,.15); }

/* ---- Panel drag handle (mobile only, hidden on desktop) ---- */
.arc-panel-drag-handle {
    display: none;
}

/* ---- Panel header ---- */
.arc-panel-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-card);
}
.arc-panel-title {
    flex: 1;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-heading);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.arc-panel-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: .2rem .4rem;
    border-radius: var(--radius);
    flex-shrink: 0;
    line-height: 1;
    transition: color var(--transition);
}
.arc-panel-close:hover {
    color: var(--text);
}

/* ---- Tabs ---- */
.arc-panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-card);
}
.arc-tab {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: .8rem;
    font-weight: 600;
    padding: .5rem .75rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: .04em;
    transition: color var(--transition), border-color var(--transition);
}
.arc-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.arc-tab:hover:not(.active) {
    color: var(--text);
}

/* ---- Content area ---- */
.arc-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    font-size: .875rem;
    line-height: 1.65;
    color: var(--text);
}
.arc-panel-content h1,
.arc-panel-content h2,
.arc-panel-content h3 {
    color: var(--text-heading);
    margin-top: 1.2em;
    margin-bottom: .5em;
}
.arc-panel-content h1 { font-size: 1.2rem; }
.arc-panel-content h2 { font-size: 1.05rem; }
.arc-panel-content h3 { font-size: .95rem; }
.arc-panel-content p  { margin-bottom: .75em; }
.arc-panel-content a  { color: var(--accent); }

.arc-panel-loading,
.arc-panel-placeholder,
.arc-panel-error,
.arc-panel-empty {
    padding: 1.5rem 1rem;
    color: var(--text-muted);
    font-size: .85rem;
    text-align: center;
}
.arc-panel-error {
    color: var(--color-error);
}

/* ---- Timeline ---- */
.tl-wrap { padding: .5rem 0 2rem; }
.tl-controls { display: flex; gap: .35rem; padding: .4rem .75rem; border-bottom: 1px solid var(--border); margin-bottom: .5rem; align-items: center; }
.tl-mode-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); font-size: .75rem; width: 24px; height: 24px; border-radius: var(--radius); cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; transition: all .15s; flex-shrink: 0; }
.tl-mode-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }
.tl-mode-btn:hover { border-color: var(--accent); color: var(--accent); }
.tl-tag-select { flex: 1; min-width: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: .7rem; padding: .2rem .35rem; cursor: pointer; }
.tl-count { font-size: .65rem; color: var(--text-muted); flex-shrink: 0; }
.tl-year--empty .tl-year-label { opacity: .3; }
.tl-year--empty .tl-year-line { opacity: .15; }
.tl-year { position: relative; padding: .25rem 0 .25rem 3.2rem; }
.tl-year-label { position: absolute; left: 0; top: .2rem; width: 2.6rem; text-align: right; font-size: .7rem; font-weight: 700; color: var(--accent); letter-spacing: .02em; }
.tl-year-line { position: absolute; left: 3rem; top: 0; bottom: 0; width: 2px; background: var(--border); }
.tl-items { display: flex; flex-direction: column; gap: .15rem; padding: .15rem 0; }
.tl-item { display: flex; align-items: center; gap: .4rem; padding: .18rem .5rem .18rem .8rem; text-decoration: none; color: var(--text); font-size: .78rem; line-height: 1.35; border-radius: var(--radius); transition: background .12s; position: relative; }
.tl-item:hover { background: var(--bg-card-hover); }
.tl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; opacity: .7; }
.tl-item:hover .tl-dot { opacity: 1; }
.tl-date { font-size: .65rem; color: var(--text-muted); width: 2.8rem; flex-shrink: 0; }
.tl-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-item[data-tl-type="encyclopedia"] .tl-dot { background: var(--text-muted); }
.tl-item[data-tl-type="event"] .tl-dot { background: var(--color-warning); }

/* ---- Sync anchors ---- */
.sync-anchor { display: inline-block; width: 0; height: 0; scroll-margin-top: 30vh; }
.sync-highlight { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; animation: sync-flash .6s ease-out; }
@keyframes sync-flash { 0% { outline-color: var(--accent); } 100% { outline-color: transparent; } }
.sync-label { display: none; }
body.is-admin .sync-label {
  display: inline-block;
  font-size: .6rem;
  background: rgba(106,219,127,.15);
  color: var(--accent);
  padding: .05rem .3rem;
  border-radius: 3px;
  vertical-align: super;
  margin: 0 2px;
  font-family: monospace;
  opacity: .7;
}
body.is-admin .sync-label.sync-label--active { opacity: 1; background: rgba(106,219,127,.3); font-weight: 700; }
.sync-section { transition: background .3s; border-radius: 4px; padding: 2px 0; border-left: 3px solid transparent; }
.sync-section:hover { border-left-color: rgba(106,219,127,.2); cursor: default; }
.sync-section--active { background: rgba(106,219,127,.08); }
.sync-section--hover { background: rgba(106,219,127,.14) !important; }

/* ---- Eye Explore ---- */
.eye-explore { padding: .5rem; }
.eye-explore__header { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .15rem 0 .25rem; }
.eye-explore__mode { font-size: .72rem; color: var(--text-muted); }
.eye-explore__rotate { background: none; border: 1px solid var(--border); color: var(--text-muted); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: .9rem; display: flex; align-items: center; justify-content: center; transition: color .15s, border-color .15s, transform .3s; padding: 0; line-height: 1; }
.eye-explore__rotate:hover { color: var(--accent); border-color: var(--accent); transform: rotate(180deg); }
.eye-explore__map { display: flex; justify-content: center; padding: .25rem 0; }
.eye-explore__map svg { max-width: 100%; height: auto; }
.eye-explore__info { text-align: center; padding: .25rem 0 .5rem; font-size: .8rem; color: var(--text-muted); min-height: 2.8rem; }
.eye-explore__mood { font-size: .7rem; opacity: .7; font-style: italic; margin-top: .15rem; }
.eye-explore__label { margin: 0 .5rem; }
.eye-explore__label em { font-style: normal; color: var(--accent); margin-left: .2rem; }
.eye-explore__results { border-top: 1px solid var(--border); padding-top: .5rem; }
.eye-explore__rtitle { font-size: .82rem; color: var(--text-heading); margin: 0 0 .4rem .25rem; font-weight: 600; }
.eye-explore__rtitle span { color: var(--text-muted); font-weight: 400; font-size: .72rem; }
.eye-explore__rlist { display: flex; flex-direction: column; gap: .1rem; }
.eye-explore__ritem { display: flex; gap: .4rem; align-items: center; padding: .25rem .4rem; text-decoration: none; color: var(--text); font-size: .78rem; border-radius: var(--radius); transition: background .1s; }
.eye-explore__ritem:hover { background: var(--bg-card-hover); }
.eye-explore__rdist { font-size: .6rem; color: var(--text-muted); width: 2rem; text-align: right; flex-shrink: 0; }
.eye-explore__rname { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eye-explore__rcoord { font-size: .6rem; color: var(--text-muted); flex-shrink: 0; }

/* ---- Tags panel ---- */
.panel-tags-wrap { padding: .5rem 0; }
.panel-tag-cloud { display: flex; flex-wrap: wrap; gap: .3rem; padding: .5rem .75rem; }
.panel-tag-btn-wrap { display: inline-flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius); transition: border-color .12s; }
.panel-tag-btn-wrap:hover { border-color: var(--accent); }
.panel-tag-btn { background: none; border: none; color: var(--text-muted); padding: .15rem .5rem; cursor: pointer; transition: color .12s; line-height: 1.4; }
.panel-tag-btn:hover { color: var(--accent); }
.panel-tag-btn.active { background: var(--accent); color: #000; }
.panel-tag-btn.active + .panel-tag-open { color: #000; border-left-color: rgba(0,0,0,.2); }
.panel-tag-open { display: flex; align-items: center; padding: 0 .3rem; border-left: 1px solid var(--border); color: var(--text-muted); text-decoration: none; font-size: .9em; transition: color .12s, background .12s; }
.panel-tag-open:hover { color: var(--accent); background: rgba(106,219,127,.08); }
.panel-tag-count { font-size: .65rem; opacity: .6; }
.panel-tag-detail { padding: 0 .75rem .75rem; }
.panel-tag-detail__title { font-size: .85rem; color: var(--text-heading); margin: .75rem 0 .5rem; font-weight: 600; }
.panel-tag-detail__title span { color: var(--text-muted); font-weight: 400; }
.panel-tag-detail__list { display: flex; flex-direction: column; gap: .1rem; }
.panel-tag-detail__item { display: flex; gap: .5rem; align-items: center; padding: .25rem .4rem; text-decoration: none; color: var(--text); font-size: .78rem; border-radius: var(--radius); transition: background .1s; }
.panel-tag-detail__item:hover { background: var(--bg-card-hover); }
.panel-tag-detail__type { font-size: .6rem; color: var(--text-muted); text-transform: uppercase; width: 2.2rem; flex-shrink: 0; }
.panel-tag-detail__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Article meta ---- */
.arc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .75rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--border);
    font-size: .75rem;
    color: var(--text-muted);
}
.arc-meta-tag {
    background: var(--color-primary-light);
    color: var(--accent);
    border-radius: var(--radius);
    padding: .1rem .45rem;
}

/* ---- Tag results list ---- */
.arc-tag-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.arc-tag-item {
    padding: .75rem;
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color var(--transition);
}
.arc-tag-item:hover {
    border-color: var(--accent);
}
.arc-tag-item-title {
    display: block;
    font-size: .875rem;
    color: var(--text-heading);
    margin-bottom: .3rem;
}
.arc-tag-item-snippet {
    font-size: .78rem;
    color: var(--text-muted);
    margin: 0 0 .4rem;
    line-height: 1.5;
}
.arc-tag-item-link {
    font-size: .75rem;
    color: var(--accent);
    text-decoration: none;
}
.arc-tag-item-link:hover {
    text-decoration: underline;
}

/* ---- Article body inside panel ---- */
.arc-article-body {
    font-size: .875rem;
}

/* ---- Eye popis (vpravo od SVG) ---- */
.arc-panel-eye-desc { flex: 1; min-width: 0; }
.arc-eye-pos { display: flex; flex-direction: column; gap: .15rem; }
.arc-eye-val { font-size: .72rem; color: var(--text-muted); line-height: 1.3; }
.arc-eye-val em { font-style: normal; color: var(--accent); margin-left: .25rem; }
.arc-eye-mood { font-size: .65rem; color: var(--text-muted); opacity: .7; line-height: 1.4; margin-top: .2rem; font-style: italic; }

/* ---- ref_file cards ---- */
.arc-reffile-card { padding: .75rem; border-bottom: 1px solid var(--border); }
.arc-reffile-card:last-child { border-bottom: none; }
.arc-reffile-title { display: block; font-size: .9rem; margin-bottom: .3rem; color: var(--text); }
.arc-reffile-perex { font-size: .8rem; color: var(--text-muted); margin: 0 0 .5rem; line-height: 1.5; }
.arc-reffile-more { background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .25rem .6rem; font-size: .75rem; color: var(--text-muted); cursor: pointer; }
.arc-reffile-more:hover { border-color: var(--accent); color: var(--accent); }
.arc-reffile-error { font-size: .8rem; color: var(--color-warning, #f59e0b); }

/* ---- Post side toggle — jen na úzkých obrazovkách ---- */
.post-layout { position: relative; }
.post-side-toggle { display: none; } /* desktop: skryto */
@media (max-width: 1023px) {
    .post-side-toggle { position: fixed; left: min(400px, 38vw); top: 1rem; transform: none; z-index: 200; width: 20px; height: 40px; background: var(--bg-card); border: 1px solid var(--border); border-left: none; border-radius: 0 4px 4px 0; cursor: pointer; font-size: .9rem; color: var(--text-muted); padding: 0; display: flex; align-items: center; justify-content: center; transition: .15s; }
    .post-side-toggle:hover { color: var(--accent); }
}
.post-sideheader { transition: width .3s ease, opacity .3s ease; z-index: 1; }
.post-layout.side-hidden .post-sideheader { width: 0; min-width: 0; overflow: hidden; opacity: 0; pointer-events: none; }
.post-layout.side-hidden { grid-template-columns: 0 1fr; }
.post-layout.side-hidden .post-side-toggle { left: 0; }

/* ---- Panel — back button + open link ---- */
.arc-panel-back {
    display: block; width: 100%; text-align: left;
    padding: .5rem .75rem; font-size: .8rem;
    color: var(--text-muted); background: none;
    border: none; border-bottom: 1px solid var(--border);
    cursor: pointer; transition: color var(--transition);
}
.arc-panel-back:hover { color: var(--accent); }
.arc-panel-openlink {
    display: block; padding: .35rem .75rem; font-size: .75rem;
    color: var(--text-muted); text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: color var(--transition);
}
.arc-panel-openlink:hover { color: var(--accent); }

/* ---- ref_file cards — collapsible ---- */
.arc-reffile-header { display: flex; align-items: flex-start; gap: .5rem; justify-content: space-between; }
.arc-reffile-actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; margin-top: .1rem; }
.arc-reffile-open { color: var(--text-muted); text-decoration: none; font-size: .85rem; transition: color var(--transition); }
.arc-reffile-open:hover { color: var(--accent); }
.arc-reffile-toggle { background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .2rem .5rem; font-size: .72rem; color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.arc-reffile-toggle:hover { border-color: var(--accent); color: var(--accent); }
.arc-reffile-body { padding: .5rem .75rem .75rem; border-top: 1px solid var(--border); margin-top: .5rem; }

/* =====================================================================
   ARC PANEL — MOBILE (bottom sheet)
   ===================================================================== */
@media (max-width: 768px) {
    #arc-panel {
        bottom: 0;
        right: 0;
        left: 0;
        top: auto;
        width: 100%;
        height: 55vh;
        border-left: none;
        border-top: 1px solid var(--border);
        box-shadow: 0 -4px 24px rgba(0,0,0,.45);
        transform: translateY(100%);
        transition: transform .28s cubic-bezier(.4,0,.2,1);
    }
    #arc-panel.open {
        transform: translateY(0);
    }

    .arc-panel-drag-handle {
        display: block;
        width: 40px;
        height: 4px;
        background: var(--border-light);
        border-radius: 2px;
        margin: .6rem auto .2rem;
        flex-shrink: 0;
        cursor: ns-resize;
        touch-action: none;
    }
    /* Na mobilu eye tab je dole, zbytečný */
    #arc-eye-tab {
        display: none;
    }
}
