/**
 * Dotekománie Base - Styly obrazové reportáže pro Swipebox (gallery-story.css)
 * 
 * - Šířka panelu je STÁLÁ a nemění se při sbalení (žádné skákání ani deformace).
 * - Tlačítko je VŽDY vpravo na svém pevném místě.
 * - Při sbalení se zobrazí první řádek textu s elipsou (...).
 * - Plynulá vertikální animace výšky na mobilu i desktopu.
 */

/* 1. ZÁKLADNÍ KONTEJNER PANELU */
#dt-story-panel {
    position: absolute;
    z-index: 2000;
    bottom: 65px;
    left: 50%;
    transform: translateX(-50%);
    width: min(680px, calc(100vw - 140px));
    max-width: 680px;
    background: rgba(18, 18, 18, 0.94);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75);
    color: #ffffff;
    box-sizing: border-box;
    border-radius: 12px;
    transition: opacity 0.2s ease, max-height 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
}

/* Aktivní stav (zobrazí se, pokud má aktuální fotka text) */
#dt-story-panel.dt-story-active {
    opacity: 1;
    pointer-events: auto;
}

/* 2. HLAVIČKA PANELU - Tlačítko stále vpravo */
.dt-story-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    gap: 12px;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
}

/* Náhled prvního řádku textu ve sbaleném stavu */
.dt-story-preview {
    display: none;
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 2px;
}

#dt-story-panel.dt-story-collapsed .dt-story-preview {
    display: block;
}

/* Ovládací tlačítko - STÁLE FIXNĚ VPRAVO */
.dt-story-toggle-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f3f4f6;
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.dt-story-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

/* 3. OBSAHOVÁ ČÁST S TEXTEM REPORTÁŽE */
.dt-story-body {
    padding: 0 16px 14px 16px;
    font-size: 14.5px;
    line-height: 1.6;
    color: #ffffff;
    overflow-y: auto;
    max-height: 220px;
    box-sizing: border-box;
    transition: max-height 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, padding 0.2s ease;
}

.dt-story-body p {
    margin: 0 0 10px 0;
}

.dt-story-body p:last-child {
    margin-bottom: 0;
}

/* Custom scrollbar pro tělo textu */
.dt-story-body::-webkit-scrollbar {
    width: 5px;
}
.dt-story-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}
.dt-story-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
}

/* SBALENÝ STAV: Šířka i pozice zůstávají 100% stejné, pouze body se hladce zasune */
#dt-story-panel.dt-story-collapsed .dt-story-body {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    opacity: 0;
    overflow: hidden;
}


/* ==========================================================================
   4. DESKTOP SPECIFIKACE (html#desktop)
   ========================================================================== */
html#desktop #dt-story-panel {
    bottom: 65px;
    left: 50%;
    transform: translateX(-50%);
    width: min(680px, calc(100vw - 140px));
    max-width: 680px;
}

html#desktop .dt-story-body {
    max-height: 220px;
}


/* ==========================================================================
   5. MOBILNÍ SPECIFIKACE (html#mobile)
   ========================================================================== */
html#mobile #dt-story-panel {
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 520px;
}

html#mobile .dt-story-body {
    max-height: 38vh;
    font-size: 13.5px;
    padding: 0 14px 12px 14px;
    -webkit-overflow-scrolling: touch;
}

html#mobile .dt-story-header {
    padding: 8px 12px;
}

html#mobile .dt-story-preview {
    font-size: 13px;
}

/* ==========================================================================
   6. OCHRANA PŘED PŘEKRYTÍM PLOVOUCÍMI PRVKY (#fw-container)
   ========================================================================== */
html.swipebox-html #fw-container,
body:has(#swipebox-overlay) #fw-container {
    display: none !important;
}
