/* PlaneSales Admin Portal Styles */

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Utility classes */
.cursor-pointer {
    cursor: pointer;
}

.cursor-pointer:hover {
    opacity: 0.9;
}

/* Admin-specific overrides */
.mud-nav-group-items .mud-nav-link {
    padding-left: 48px !important;
}

/* Dashboard cards hover effect */
.mud-card.cursor-pointer {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mud-card.cursor-pointer:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Data grid styling */
.mud-table-toolbar {
    padding: 16px;
}

/* Form styling */
.form-section {
    margin-bottom: 24px;
}

.form-section-title {
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

/* Status badges */
.status-active {
    color: #4caf50;
}

.status-pending {
    color: #ff9800;
}

.status-inactive {
    color: #9e9e9e;
}

.status-rejected {
    color: #f44336;
}

/* Charts container */
.chart-container {
    position: relative;
    min-height: 300px;
}

/* Print styles */
@media print {
    .mud-drawer,
    .mud-appbar,
    .no-print {
        display: none !important;
    }

    .mud-main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* ============================================================================
   Page builder block preview + media blocks (FTR-PSG-2026-0503 / 0504)
   Renders the admin preview canvas. Public rendering styles are FTR-0505.
   ============================================================================ */

.preview-block {
    margin: 0 0 1.75rem;
}

    .preview-block:last-child {
        margin-bottom: 0;
    }

/* Shared block layout variants (also used by heading / rich-text). */
.preview-block.layout-contained {
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}

.preview-block.layout-wide {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.preview-block.layout-full {
    max-width: none;
}

/* --- Image block --- */
.content-image {
    margin: 0;
}

    .content-image img {
        display: block;
        width: 100%;
        height: auto;
        border-radius: 6px;
    }

    .content-image figcaption {
        margin-top: 0.5rem;
        font-size: 0.85rem;
        color: var(--mud-palette-text-secondary, #6b6b6b);
        text-align: center;
    }

/* Standalone image alignment (float on wide viewports, full-width on mobile). */
.preview-block.layout-image-left .content-image,
.preview-block.layout-image-right .content-image {
    max-width: 48%;
}

.preview-block.layout-image-left .content-image {
    float: left;
    margin: 0 1.5rem 1rem 0;
}

.preview-block.layout-image-right .content-image {
    float: right;
    margin: 0 0 1rem 1.5rem;
}

.content-image-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    background: repeating-linear-gradient(45deg, #f2f2f2, #f2f2f2 10px, #e9e9e9 10px, #e9e9e9 20px);
    color: #999;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* --- Image + text block (side by side, stacks on mobile) --- */
.content-image-text {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

    .content-image-text .cit-image {
        flex: 0 0 45%;
        max-width: 45%;
    }

        .content-image-text .cit-image img {
            display: block;
            width: 100%;
            height: auto;
            border-radius: 6px;
        }

    .content-image-text .cit-text {
        flex: 1 1 auto;
        min-width: 0;
    }

/* Image-right variant reverses the flow. */
.preview-block.layout-image-right .content-image-text {
    flex-direction: row-reverse;
}

/* --- Text-over-image block (CSS overlay: real, selectable text) --- */
.text-over-image {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
}

    .text-over-image img {
        display: block;
        width: 100%;
        height: auto;
    }

    /* Optional scrim for legibility (SEC-friendly contrast handling). */
    .text-over-image.tovi-scrim::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        pointer-events: none;
    }

    .text-over-image .tovi-overlay {
        position: absolute;
        z-index: 1;
        max-width: 80%;
        color: #fff;
        font-weight: 600;
        line-height: 1.2;
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
        white-space: pre-wrap;
    }

/* Overlay position (3x3 grid). */
.tovi-pos-top-left .tovi-overlay { top: 6%; left: 5%; text-align: left; }
.tovi-pos-top-center .tovi-overlay { top: 6%; left: 50%; transform: translateX(-50%); text-align: center; }
.tovi-pos-top-right .tovi-overlay { top: 6%; right: 5%; text-align: right; }
.tovi-pos-middle-left .tovi-overlay { top: 50%; left: 5%; transform: translateY(-50%); text-align: left; }
.tovi-pos-middle-center .tovi-overlay { top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.tovi-pos-middle-right .tovi-overlay { top: 50%; right: 5%; transform: translateY(-50%); text-align: right; }
.tovi-pos-bottom-left .tovi-overlay { bottom: 6%; left: 5%; text-align: left; }
.tovi-pos-bottom-center .tovi-overlay { bottom: 6%; left: 50%; transform: translateX(-50%); text-align: center; }
.tovi-pos-bottom-right .tovi-overlay { bottom: 6%; right: 5%; text-align: right; }

/* Stepped, responsive overlay sizes (clamp → scale with viewport, never fixed px). */
.tovi-size-s .tovi-overlay { font-size: clamp(0.9rem, 2.5vw, 1.25rem); }
.tovi-size-m .tovi-overlay { font-size: clamp(1.1rem, 3.5vw, 1.75rem); }
.tovi-size-l .tovi-overlay { font-size: clamp(1.4rem, 5vw, 2.5rem); }
.tovi-size-xl .tovi-overlay { font-size: clamp(1.8rem, 7vw, 3.5rem); }

/* Curated brand fonts — self-hosted / system stacks only (no external font CDN). */
/* [RFT-PSG-2026-0727] The overlay's "sans" choice follows the platform face (Inter).
   serif / display / mono below are deliberate editor options and are unchanged. */
.tovi-font-sans .tovi-overlay { font-family: var(--ps-font-family, 'Inter', Arial, Helvetica, sans-serif); }
.tovi-font-serif .tovi-overlay { font-family: Georgia, 'Times New Roman', Times, serif; }
.tovi-font-display .tovi-overlay { font-family: 'Arial Black', 'Helvetica Neue', Impact, sans-serif; letter-spacing: 0.01em; }
.tovi-font-mono .tovi-overlay { font-family: 'Courier New', Courier, monospace; }

/* --- YouTube video block (responsive 16:9, no fixed pixel height) --- */
.content-video {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
}

    .content-video iframe {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
    }

/* ============================================================================
   FTR-PSG-2026-0608 editorial blocks — admin preview mirror of the public render.
   ============================================================================ */

/* --- Hero (full-width image + headline/standfirst overlay) --- */
.content-hero {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
}

    .content-hero img {
        display: block;
        width: 100%;
        height: auto;
    }

    .content-hero.tovi-scrim::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.15) 45%, rgba(0, 0, 0, 0) 75%);
        pointer-events: none;
    }

    .content-hero .content-hero-overlay {
        position: absolute;
        z-index: 1;
        max-width: 90%;
        color: #fff;
        text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
    }

        .content-hero .content-hero-overlay .hero-headline {
            font-size: clamp(1.6rem, 5vw, 3.5rem);
            font-weight: 700;
            line-height: 1.1;
        }

        .content-hero .content-hero-overlay .hero-standfirst {
            margin-top: 0.5rem;
            font-size: clamp(1rem, 2.2vw, 1.5rem);
            line-height: 1.3;
        }

/* Hero overlay position reuses the shared 3x3 tovi-pos-* grid, scoped to the hero overlay. */
.content-hero.tovi-pos-top-left .content-hero-overlay { top: 6%; left: 5%; text-align: left; }
.content-hero.tovi-pos-top-center .content-hero-overlay { top: 6%; left: 50%; transform: translateX(-50%); text-align: center; }
.content-hero.tovi-pos-top-right .content-hero-overlay { top: 6%; right: 5%; text-align: right; }
.content-hero.tovi-pos-middle-left .content-hero-overlay { top: 50%; left: 5%; transform: translateY(-50%); text-align: left; }
.content-hero.tovi-pos-middle-center .content-hero-overlay { top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.content-hero.tovi-pos-middle-right .content-hero-overlay { top: 50%; right: 5%; transform: translateY(-50%); text-align: right; }
.content-hero.tovi-pos-bottom-left .content-hero-overlay { bottom: 6%; left: 5%; text-align: left; }
.content-hero.tovi-pos-bottom-center .content-hero-overlay { bottom: 6%; left: 50%; transform: translateX(-50%); text-align: center; }
.content-hero.tovi-pos-bottom-right .content-hero-overlay { bottom: 6%; right: 5%; text-align: right; }

/* --- Inline image (floated captioned/credited figure; body text wraps) --- */
.content-inline-image {
    overflow: hidden; /* contains the float within this block */
}

    .content-inline-image .cii-figure {
        margin: 0;
    }

        .content-inline-image .cii-figure img {
            display: block;
            width: 100%;
            height: auto;
            border-radius: 6px;
        }

        .content-inline-image .cii-figure figcaption {
            margin-top: 0.4rem;
            font-size: 0.85rem;
            color: var(--mud-palette-text-secondary, #6b6b6b);
        }

        .content-inline-image .cii-figure .cii-caption {
            display: block;
        }

        .content-inline-image .cii-figure .cii-credit {
            display: block;
            font-style: italic;
            opacity: 0.8;
            font-size: 0.8rem;
        }

.preview-block.layout-image-left .content-inline-image .cii-figure {
    float: left;
    max-width: 45%;
    margin: 0 1.5rem 1rem 0;
}

.preview-block.layout-image-right .content-inline-image .cii-figure {
    float: right;
    max-width: 45%;
    margin: 0 0 1rem 1.5rem;
}

.preview-block.layout-full .content-inline-image .cii-figure {
    float: none;
    max-width: 100%;
    margin: 0 0 1rem;
}

/* --- Gallery (responsive grid of figures) --- */
.content-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

    .content-gallery .content-gallery-item {
        margin: 0;
    }

        .content-gallery .content-gallery-item img {
            display: block;
            width: 100%;
            height: auto;
            border-radius: 6px;
        }

        .content-gallery .content-gallery-item figcaption {
            margin-top: 0.35rem;
            font-size: 0.8rem;
            color: var(--mud-palette-text-secondary, #6b6b6b);
        }

/* --- Pull-quote --- */
.content-pullquote {
    margin: 0.5rem 0;
    padding: 0.5rem 0 0.5rem 1.25rem;
    border-left: 4px solid currentColor;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    line-height: 1.35;
    font-style: italic;
}

    .content-pullquote p {
        margin: 0;
    }

    .content-pullquote cite {
        display: block;
        margin-top: 0.5rem;
        font-size: 0.95rem;
        font-style: normal;
        opacity: 0.75;
    }

        .content-pullquote cite::before {
            content: "\2014\00a0";
        }

/* --- Article header (byline + date) --- */
.content-articleheader {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: var(--mud-palette-text-secondary, #6b6b6b);
}

    .content-articleheader .cah-byline {
        font-weight: 600;
    }

/* --- Mobile: stack image+text, tame floats/overlay --- */
@media (max-width: 600px) {
    .preview-block.layout-image-left .content-inline-image .cii-figure,
    .preview-block.layout-image-right .content-inline-image .cii-figure {
        float: none;
        max-width: 100%;
        margin: 0 0 1rem;
    }

    .content-hero .content-hero-overlay {
        max-width: 92%;
    }

    .content-image-text,
    .preview-block.layout-image-right .content-image-text {
        flex-direction: column;
    }

        .content-image-text .cit-image {
            flex-basis: auto;
            max-width: 100%;
        }

    .preview-block.layout-image-left .content-image,
    .preview-block.layout-image-right .content-image {
        float: none;
        max-width: 100%;
        margin: 0 0 1rem;
    }

    .text-over-image .tovi-overlay {
        max-width: 92%;
    }
}
