/* ============================================================
   ARECH Video Embed — block-36 view.css
   Self-hosted video with click-to-load pattern.
   All values reference design-system-v1.md tokens (no magic numbers).
   Composite-only animations (transform / opacity / filter).
   Mandatory @media (prefers-reduced-motion: reduce) hard gate.
   ============================================================ */

.arech-ve {
    padding-block: var(--space-9);
    padding-inline: var(--container-px);
}
.arech-ve--theme-dark    { background-color: var(--dark); color: var(--off-white); }
.arech-ve--theme-paper-2 { background-color: var(--paper-2); color: var(--ink-1);}
.arech-ve--theme-paper-1 { background-color: var(--paper-1); color: var(--ink-1);}

.arech-ve__inner {
    /* S72 canonical multi-element box: gutter lives on the band
       (.arech-ve), inner is capped at --container with no inner padding.
       Renders identically to the prior calc(--container + 2·gutter) form
       (border-box absorbs the gutter), but uses the single block idiom. */
    max-width: var(--container);
    margin-inline: auto;
}

.arech-ve__eyebrow {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--orange);
    margin: 0 0 var(--space-3);
}

.arech-ve__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.1;
    margin: 0 0 var(--space-4);
    max-width: 24ch;
}

.arech-ve__body {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.6;
    max-width: 60ch;
    margin: 0 0 var(--space-7);
    opacity: 0.86;
}

/* ---------- Media wrapper with aspect-ratio + container query ---------- */
.arech-ve__media {
    position: relative;
    width: 100%;
    background-color: var(--dark-3);
    overflow: hidden;
    border-radius: var(--radius-sm);
    container-type: inline-size;
}

.arech-ve--aspect-16-9 .arech-ve__media { aspect-ratio: 16 / 9; }
.arech-ve--aspect-4-3  .arech-ve__media { aspect-ratio: 4 / 3; }
.arech-ve--aspect-1-1  .arech-ve__media { aspect-ratio: 1 / 1; }

/* ---------- Poster (click-to-load) ---------- */
.arech-ve__poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 2;
    transition: opacity var(--motion-normal) var(--ease-standard);
}

.arech-ve__poster:focus-visible {
    outline: 3px solid var(--orange);
    outline-offset: -3px;
}

.arech-ve__poster-pic,
.arech-ve__poster-pic img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.arech-ve__poster::after {
    /* G-fix C1: was rgba(0,0,0,0.18→0.42) magic literals — tokenised via color-mix per design-system. */
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        color-mix(in oklch, var(--dark) 18%, transparent),
        color-mix(in oklch, var(--dark) 42%, transparent)
    );
    z-index: 1;
}

.arech-ve__play {
    position: relative;
    z-index: 2;
    color: var(--off-white);
    /* G-fix C2: was rgba(0,0,0,0.4) magic literal — tokenised via color-mix. */
    filter: drop-shadow(0 4px 16px color-mix(in oklch, var(--dark) 40%, transparent));
    transition: transform var(--motion-normal) var(--ease-standard);
}

.arech-ve__poster:hover .arech-ve__play,
.arech-ve__poster:focus-visible .arech-ve__play {
    transform: scale(1.08);
    color: var(--orange);
}

.arech-ve__poster.is-played {
    opacity: 0;
    pointer-events: none;
}

/* ---------- Video element ---------- */
.arech-ve__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background-color: var(--dark);
    z-index: 1;
}

/* ---------- Placeholder (no video uploaded yet — TBD_OPERATOR) ---------- */
.arech-ve__placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: var(--space-3);
    color: var(--muted-accessible);
    background-color: var(--dark-2);
    text-align: center;
}

.arech-ve__placeholder-icon { display: block; }

.arech-ve__placeholder-label {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0;
}

/* ---------- Visible caption ---------- */
.arech-ve__caption {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted-accessible);
    margin: var(--space-4) 0 0;
    text-align: center;
}

/* ---------- Reduced-motion: HARD gate per WCAG 2.2 AA + CLAUDE.md motion budget ---------- */
@media (prefers-reduced-motion: reduce) {
    .arech-ve__poster,
    .arech-ve__play {
        transition: none;
    }
    .arech-ve__poster:hover .arech-ve__play,
    .arech-ve__poster:focus-visible .arech-ve__play {
        transform: none;
    }
    /* Reduced-motion: video must NOT autoplay even if operator toggles it.
       The click-to-load pattern already requires interaction, so this is
       enforced at the JS layer; the CSS reduce branch documents the intent. */
}

/* ---------- Concrete edit-mode shim — keep video paused + visible in editor ---------- */
.ccm-edit-mode .arech-ve__video {
    pointer-events: none;
}

/* ---------- Print: strip media + show caption ---------- */
@media print {
    .arech-ve { background: #fff !important; color: #000 !important; padding-block: var(--space-5); }
    .arech-ve__media { display: none; }
    .arech-ve__caption { color: #000; text-align: left; }
}
