/* ==========================================================================
   Story Banner — 1080×1920 Instagram Story generator
   --------------------------------------------------------------------------
   Only the modal / preview chrome lives here (shared by BOTH generators):
     • property pages  → assets/js/property-story-banner.js
     • site stories    → assets/js/story-banner.js
   The banner itself is always drawn on a <canvas> so the output is a true,
   pixel-exact 1080×1920 PNG with correct Persian shaping (no html2canvas
   RTL bugs, no external dependencies).
   Loaded on every landing page (see views/layouts/landing.php).
   ========================================================================== */

.psb-preview {
    position: relative;
    width: 100%;
    max-width: min(360px, 58vh);
    margin: 0 auto;
    aspect-ratio: 9 / 16;
    background: #0B123F;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(11, 18, 63, 0.35), 0 4px 16px rgba(0, 0, 0, 0.2);
}

.psb-preview canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Loading veil — sits above the canvas while fonts + images resolve. */
.psb-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(11, 18, 63, 0.92);
    color: #D9A64F;
    transition: opacity 0.25s ease;
    z-index: 2;
}

.psb-loading[hidden] {
    opacity: 0;
    pointer-events: none;
}

.psb-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(217, 166, 79, 0.25);
    border-top-color: #D9A64F;
    animation: psb-spin 0.8s linear infinite;
}

.psb-loading-text {
    font-family: 'Estedad', 'Vazirmatn', Tahoma, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #E5E3DC;
}

@keyframes psb-spin {
    to { transform: rotate(360deg); }
}

/* Failure veil — shown when the image/font pipeline can't produce a banner. */
.psb-error {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    text-align: center;
    background: rgba(11, 18, 63, 0.94);
    color: #E5E3DC;
    z-index: 3;
    font-family: 'Estedad', 'Vazirmatn', Tahoma, sans-serif;
    font-size: 13px;
    font-weight: 600;
}

.psb-error i {
    font-size: 30px;
    color: #D9A64F;
}

@media (prefers-reduced-motion: reduce) {
    .psb-spinner { animation-duration: 1.6s; }
}
