/* ── Lightbulb Widget ── v2.0.0 ───────────────────────────────────────────── */

/* ── Sky overlay ────────────────────────────────────────────────────────── */
.lbw-root {
    position: relative;
}

.lbw-sky {
    position: fixed;
    inset: 0;
    background: #07090f;
    z-index: 9990;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.7s ease;
}
.lbw-sky.lbw-on {
    opacity: 1;
}
.lbw-sky .lbw-star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
}

/* ── Lamp assembly ──────────────────────────────────────────────────────── */
.lbw-lamp-wrap {
    position: fixed;
    top: 60px;
    left: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    user-select: none;
}

.lbw-mount {
    display: none;
}

.lbw-wire {
    display: none;
}

.lbw-bulb-svg {
    width: 80px;
    height: 88px;
    overflow: visible;
    transition: filter 0.4s ease;
    cursor: pointer;
}
.lbw-lamp-wrap.lbw-on .lbw-bulb-svg {
    filter: drop-shadow(0 0 18px rgba(255,220,60,.9))
            drop-shadow(0 0 40px rgba(255,180,30,.5));
}
.lbw-lamp-wrap.lbw-on .lbw-globe    { fill: #fff8c0; stroke: #e0c040; }
.lbw-lamp-wrap.lbw-on .lbw-halo     { fill: rgba(255,230,80,.18); }
.lbw-lamp-wrap.lbw-on .lbw-filament { stroke: rgba(255,200,50,1); }

.lbw-cord-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    outline: none;
}
.lbw-cord-wrap:focus-visible .lbw-knob {
    outline: 2px solid #f5c542;
    outline-offset: 2px;
}

.lbw-cord {
    width: 2px;
    height: 54px;
    background: linear-gradient(180deg, #a08060 0%, #c8a878 100%);
    border-radius: 1px;
    transform-origin: top center;
    transition: transform 0.15s ease;
}
.lbw-knob {
    width: 14px;
    height: 14px;
    background: radial-gradient(circle at 40% 35%, #f0d080, #b07830);
    border-radius: 50%;
    border: 1px solid #8a5820;
    transition: transform 0.15s ease;
}
.lbw-lamp-wrap.lbw-pulling .lbw-cord { transform: rotate(12deg); }
.lbw-lamp-wrap.lbw-pulling .lbw-knob { transform: translateX(12px); }

/* ── Book mode: dark panel ──────────────────────────────────────────────── */
.lbw-book-mode {
    background: #0e0f14;
    border-radius: 8px;
    padding: 100px 32px 48px 32px;
    min-height: 300px;
    transition: background 0.7s ease;
}
.lbw-book-mode.lbw-lit {
    background: #13141a;
}

/* OFF hint */
.lbw-off-hint {
    position: relative;
    z-index: 9995;
    text-align: center;
    padding: 60px 20px 40px;
    transition: opacity 0.5s ease;
    pointer-events: none;
}
.lbw-off-hint.lbw-hidden {
    opacity: 0;
    height: 0;
    padding: 0;
    overflow: hidden;
}
.lbw-hint-icon {
    display: block;
    font-size: 48px;
    margin-bottom: 12px;
    opacity: .35;
}
.lbw-hint-text {
    display: block;
    font-size: 16px;
    color: rgba(255,255,255,.2);
    font-family: Tahoma, Arial, sans-serif;
    direction: rtl;
}

/* ── Article ────────────────────────────────────────────────────────────── */
.lbw-article {
    position: relative;
    z-index: 9995;
    direction: rtl;
    font-family: Tahoma, 'Vazirmatn', Arial, sans-serif;
    line-height: 1.9;
    font-size: 15px;

    /* Hidden until light on */
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.9s ease 0.3s, transform 0.9s ease 0.3s;
    pointer-events: none;
}
.lbw-article.lbw-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Article typography — warm on dark */
.lbw-article h1 {
    font-size: 1.7em;
    color: #f5d782;
    border-bottom: 1px solid rgba(245,215,130,.2);
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.lbw-article h2 {
    font-size: 1.25em;
    color: #f0c46a;
    margin-top: 36px;
    margin-bottom: 10px;
    border-right: 4px solid #f0c46a;
    padding-right: 10px;
}
.lbw-article h3 {
    font-size: 1.05em;
    color: #e0ad55;
    margin-top: 20px;
    margin-bottom: 8px;
}
.lbw-article p {
    color: #d0c8b8;
    margin-bottom: 14px;
}
.lbw-article ul, .lbw-article ol {
    color: #c8c0b0;
    padding-right: 24px;
    margin-bottom: 14px;
}
.lbw-article li {
    margin-bottom: 6px;
}
.lbw-article strong {
    color: #f0c46a;
    font-weight: bold;
}
.lbw-article em {
    color: #b0a898;
    font-style: italic;
}
.lbw-article hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,.1);
    margin: 32px 0;
}
.lbw-article code {
    background: rgba(255,255,255,.07);
    border-radius: 3px;
    padding: 2px 6px;
    font-size: .9em;
    color: #f0c46a;
    font-family: monospace;
}

/* ── Twinkling stars ────────────────────────────────────────────────────── */
@keyframes lbw-twinkle {
    0%, 100% { opacity: 1;   transform: scale(1); }
    50%       { opacity: .15; transform: scale(.5); }
}
