/* ----------------------------------------
   WORK DETAIL STYLES
   ---------------------------------------- */

/* Štýly pre obrázok ilustrácie */
.story-illustration {
    float: left;
    margin: 0 20px 15px 0;
    max-width: 400px;
    height: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* Optimalizacia pre Core Web Vitals */
    aspect-ratio: 4/3;
    object-fit: cover;
    will-change: transform;
    contain: layout;
}

.story-illustration:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

/* Preload hint pre kritické obrázky */
.story-illustration[data-priority="high"] {
    content-visibility: auto;
    contain-intrinsic-size: 400px 300px;
}

/* Responzívne štýly pre obrázok */
@media (max-width: 768px) {
    .story-illustration {
        float: none;
        display: block;
        margin: 0 auto 20px auto;
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .story-illustration {
        max-width: 100%;
        margin: 0 0 15px 0;
    }
}

/* Základné štýly pre obsah diela */
.work-content {
    font-size: 1.1rem;
    line-height: 1.7;
    position: relative; /* Dôležité pre poziciovanie záložiek */
    /* Optimalizacia pre Core Web Vitals - predchádzanie CLS */
    min-height: 300px;
    contain: layout style;
}

.work-title {
    font-size: 2rem;
}

.author-info {
    font-size: 1.1rem;
}

/* Štýly pre značky a štatistiky */
.stats-badge {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.tags-container {
    margin-top: 0.5rem;
}

.content-tag {
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

/* Štýly pre kartu a jej časti */
.card-header {
    background-color: rgba(0, 0, 0, 0.03);
    padding: 1rem 1.25rem;
}

.card-footer {
    padding: 1rem 1.25rem;
}

/* Štýl pre vysvetlenie funkcie záložky */
.bookmark-hint {
    position: relative;
    margin-bottom: 15px;
    padding: 10px;
    background-color: rgba(0, 123, 255, 0.05);
    border-left: 3px solid #0d6efd;
    font-size: 0.9rem;
    color: #505050;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.bookmark-hint i {
    margin-right: 8px;
    color: #0d6efd;
    font-size: 1.2rem;
}

/* Štýly pre ikonu lupy a ovládač veľkosti písma */
.font-size-toggle, .favorite-toggle {
    position: fixed;
    width: 40px;
    height: 40px;
    background-color: #ffffff !important;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer !important;
    transition: all 0.2s ease;
    user-select: none;
    border: 1px solid #e6e6e6;
}

/* Pozícia pre font size toggle */
.font-size-toggle {
    top: 180px;
    right: 20px;
}

/* Pozícia pre favorite toggle */
.favorite-toggle {
    top: 120px;
    right: 20px;
}

.font-size-toggle:hover, .favorite-toggle:hover {
    background-color: #f8f9fa;
    transform: scale(1.1);
}

.font-size-toggle:active, .favorite-toggle:active {
    background-color: #e9ecef;
    transform: scale(0.95);
}

.font-size-toggle i, .favorite-toggle i {
    pointer-events: none;
}

.font-size-toggle i {
    color: #0d6efd !important;
    font-size: 1.2rem;
}

.favorite-toggle i.bi-heart-fill {
    color: #dc3545 !important; /* Červená farba pre vyplnené srdce */
}

.favorite-toggle i.bi-heart {
    color: #dc3545 !important; /* Červená farba pre nevyplnené srdce */
}

/* Ovládanie veľkosti písma */
.font-size-control {
    position: fixed;
    top: 180px;
    right: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1060; /* Vyšší z-index než lupa */
    display: none;
    flex-direction: column;
    padding: 5px;
    transition: all 0.3s ease;
    min-width: 200px;
}

.font-size-control.visible {
    display: flex;
}

.font-size-control button {
    border: none;
    background-color: transparent;
    color: #0d6efd;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.font-size-control button:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

.font-size-control button:active {
    background-color: rgba(13, 110, 253, 0.2);
}

.font-size-control button i {
    pointer-events: none; /* Dôležité - zabraňuje problémom s event bubbling */
}

.font-size-control .font-size-divider {
    height: 1px;
    background-color: #dee2e6;
    margin: 4px 6px;
}

.font-size-control .font-size-value {
    text-align: center;
    font-size: 0.85rem;
    margin: 2px 0;
    color: #6c757d;
}

/* Štýly pre riadok s ovládačmi veľkosti */
.font-controls-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px;
    width: 100%;
}

.font-controls-row button {
    margin: 0 2px;
}

.font-controls-row .font-size-value {
    min-width: 40px;
    text-align: center;
    margin: 0 4px;
}

/* Výber fontov sekcia */
.font-family-section {
    padding: 8px 6px;
}

.font-family-select {
    width: 100%;
    font-size: 0.85rem;
    padding: 4px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #f8f9fa;
}

/* Utility triedy */
.btn-6rem { width: 6rem; }

/* Responzívny dizajn */
@media (max-width: 768px) {
    .font-size-toggle,
    .font-size-control,
    .favorite-toggle {
        right: 10px;
    }

    .favorite-toggle {
        top: 80px;
    }

    .font-size-toggle {
        top: 140px;
    }

    .font-size-control {
        top: 140px;
    }
}
