/**
 * Auguren Story - isolated left drawer styles.
 * Namespaced to avoid touching the main Auguren UI.
 */

.auguren-story-toggle,
.auguren-story-diagrams-toggle {
    position: absolute;
    left: 10px;
    z-index: 812;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(45, 75, 88, 0.18);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.96);
    color: #2f6d85;
    box-shadow: 0 2px 8px rgba(28, 39, 49, 0.18);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-10px);
    transition: opacity 160ms ease, transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.auguren-story-toggle {
    top: 190px;
}

.auguren-story-diagrams-toggle {
    top: 234px;
}

.auguren-story-toggle.is-visible,
.auguren-story-diagrams-toggle.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.auguren-story-toggle:hover,
.auguren-story-toggle.is-active,
.auguren-story-diagrams-toggle:hover,
.auguren-story-diagrams-toggle.is-active {
    background: #2f6d85;
    border-color: #2f6d85;
    color: #fff;
    box-shadow: 0 4px 14px rgba(28, 39, 49, 0.22);
}

.auguren-story-toggle svg,
.auguren-story-diagrams-toggle svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auguren-story-drawer {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 106px;
    z-index: 811;
    width: min(370px, calc(100vw - 58px));
    display: flex;
    flex-direction: column;
    background: rgba(250, 252, 250, 0.97);
    border-right: 1px solid rgba(45, 75, 88, 0.14);
    box-shadow: 10px 0 28px rgba(28, 39, 49, 0.16);
    color: #1f2e35;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-104%);
    transition: transform 220ms ease, opacity 180ms ease;
}

.auguren-story-drawer.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.auguren-story-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 22px 14px;
    border-bottom: 1px solid rgba(45, 75, 88, 0.1);
}

.auguren-story-eyebrow {
    margin-bottom: 5px;
    color: #5f7f6f;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auguren-story-title {
    margin: 0;
    color: #1f2e35;
    font-size: 18px;
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: 0;
}

.auguren-story-close {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(45, 75, 88, 0.14);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.78);
    color: #516872;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.auguren-story-close:hover {
    background: #eff5f2;
    color: #1f2e35;
}

.auguren-story-context {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 14px 22px 2px;
}

.auguren-story-context span {
    max-width: 100%;
    padding: 5px 8px;
    border: 1px solid rgba(47, 109, 133, 0.16);
    border-radius: 6px;
    background: rgba(238, 247, 244, 0.86);
    color: #38515c;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.auguren-story-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 22px 26px;
}

.auguren-story-section {
    padding: 16px 0;
    border-bottom: 1px solid rgba(45, 75, 88, 0.1);
}

.auguren-story-section:last-child {
    border-bottom: 0;
}

.auguren-story-section.is-hidden {
    display: none;
}

.auguren-story-section h3 {
    margin: 0 0 8px;
    color: #5f7f6f;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.auguren-story-section p {
    margin: 0;
    color: #24343b;
    font-size: 14px;
    font-weight: 450;
    line-height: 1.58;
    letter-spacing: 0;
}

.auguren-story-care-section p {
    color: #5c5546;
}

@media (max-width: 640px) {
    .auguren-story-toggle {
        top: 192px;
        width: 34px;
        height: 34px;
    }

    .auguren-story-diagrams-toggle {
        top: 234px;
        width: 34px;
        height: 34px;
    }

    .auguren-story-toggle svg,
    .auguren-story-diagrams-toggle svg {
        width: 19px;
        height: 19px;
    }

    .auguren-story-drawer {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        max-height: 64vh;
        border-right: 0;
        border-top: 1px solid rgba(45, 75, 88, 0.14);
        border-radius: 12px 12px 0 0;
        box-shadow: 0 -10px 26px rgba(28, 39, 49, 0.18);
        transform: translateY(104%);
    }

    .auguren-story-drawer.is-open {
        transform: translateY(0);
    }

    .auguren-story-header {
        padding: 18px 18px 12px;
    }

    .auguren-story-context {
        padding: 12px 18px 0;
    }

    .auguren-story-content {
        padding: 12px 18px 22px;
    }

    .auguren-story-section {
        padding: 14px 0;
    }

    .auguren-story-section p {
        font-size: 13px;
        line-height: 1.55;
    }
}
