:root {
    --bg-color: #1a1a1a;
    --header-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --text-muted: #9e9e9e;
    --accent-color: #007ac2;
    --border-color: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

header {
    background-color: var(--header-bg);
    padding: 15px 40px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

h1 { margin: 0; font-size: 20px; font-weight: bold; }

.back-btn {
    text-decoration: none;
    color: white;
    background-color: var(--accent-color);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.back-btn:hover { background-color: #0099f7; }

.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
}

aside {
    position: sticky;
    top: 100px;
    height: fit-content;
}

aside h3 { margin-top: 20px; margin-bottom: 10px; color: white; font-size: 16px; border-bottom: 1px solid var(--border-color); padding-bottom: 5px; }
aside h3:first-child { margin-top: 0; }

aside ul { list-style: none; padding: 0; margin: 0; }
aside li { margin-bottom: 8px; }
aside a {
    text-decoration: none;
    color: var(--text-muted);
    padding-left: 10px;
    display: block;
    font-size: 14px;
    transition: color 0.2s;
    border-left: 2px solid transparent;
}
aside a:hover { color: var(--accent-color); border-left-color: var(--accent-color); }

.part-header {
    margin-top: 60px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}
.part-header h2 {
    font-size: 32px;
    color: var(--accent-color);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

article {
    margin-bottom: 60px;
    scroll-margin-top: 100px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 40px;
}
article:last-child { border-bottom: none; }

h3.method-title { color: white; font-size: 24px; margin-bottom: 20px; margin-top: 0; }

.content-layout { display: flex; gap: 30px; flex-wrap: wrap; }
.text-column { flex: 1; min-width: 300px; }
.image-column { flex: 1; min-width: 300px; }

figure { margin: 0; }
img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: rgba(0,0,0,0.2);
    min-height: 200px;
    object-fit: cover;
}
figcaption { font-size: 13px; color: var(--text-muted); text-align: center; margin-top: 8px; font-style: italic; }

/* === STYLY PRO CITACE (TOOLTIP) === */
.citation-trigger {
    color: var(--accent-color);
    cursor: pointer;
    position: relative;
    font-weight: bold;
    display: inline-block;
    border-bottom: 1px dashed var(--accent-color);
}

.citation-trigger:hover {
    background-color: rgba(0, 122, 194, 0.1);
}

.citation-popup {
    visibility: hidden;
    width: 350px;
    background-color: #2b2b2b;
    color: var(--text-color);
    text-align: left;
    border-radius: 6px;
    padding: 12px;
    
    /* Pozicování */
    position: absolute;
    z-index: 1000;
    bottom: 135%;
    left: 50%;
    margin-left: -175px;
    
    /* Vzhled */
    border: 1px solid var(--accent-color);
    box-shadow: 0 5px 20px rgba(0,0,0,0.6);
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
    
    /* Typografie v bublině */
    font-size: 12px;
    font-weight: normal;
    font-style: normal;
    line-height: 1.4;
}

.citation-popup strong {
    display: block;
    margin-bottom: 4px;
    color: var(--accent-color);
}

/* NOVÉ: Odkazy uvnitř tooltipu budou mít stejnou barvu (modrou) */
.citation-popup a {
    color: var(--accent-color);
    text-decoration: none;
}
.citation-popup a:hover {
    text-decoration: underline;
}

/* Šipka bubliny */
.citation-popup::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: var(--accent-color) transparent transparent transparent;
}

.citation-trigger:hover .citation-popup,
.citation-trigger:focus .citation-popup {
    visibility: visible;
    opacity: 1;
    bottom: 125%;
}

@media (max-width: 768px) {
    .container { grid-template-columns: 1fr; }
    aside { display: none; }
    .citation-popup { 
        width: 250px; 
        margin-left: -125px; 
    }
}