/* SOP media layout: billeder øverst, tekst nederst; naturlig størrelse side om side */
.sop-page {
    display: flex;
    flex-direction: column;
}

.sop-media {
    order: 1;
    margin: 0 0 1.25rem;
    padding: 0;
    border: none;
}

.sop-step-head {
    order: 2;
}

.sop-body {
    order: 3;
}

.sop-images {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem 1.25rem;
    margin: 0;
}

.sop-image-ref {
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    max-width: 100%;
}

.sop-image-ref--qr {
    border: none;
    max-width: 160px;
}

.sop-hero.message-image,
.sop-image-ref img.sop-hero {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    border-radius: 0;
    cursor: zoom-in;
    background: transparent;
}


/* Image loading status — same feel as AI thinking bubble */
.sop-image-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.35rem 0 0.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.75rem;
    background: #f1f5f9;
    color: #334155;
    max-width: 100%;
}

.sop-image-loading-spinner {
    width: 1.25rem;
    height: 1.25rem;
    color: #3b82f6;
    flex: 0 0 auto;
    animation: spin 0.9s linear infinite;
}

.sop-image-loading-label {
    font-weight: 600;
    color: #334155;
}

.sop-image-loading-secs {
    font-variant-numeric: tabular-nums;
    color: #64748b;
    font-weight: 500;
    min-width: 1.6rem;
}

.sop-image-caption {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    line-height: 1.35;
    color: #4a4a4a; /* mørkegrå billedtekst */
}

.sop-image-caption--missing {
    color: #666666;
    font-style: italic;
}

.sop-qr-row {
    margin: 0.4rem 0 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.55rem;
    font-size: 0.9rem;
}

.sop-qr-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #0a1238;
    background: linear-gradient(135deg, #9ec1ff, #c9d9ff);
}

.sop-media-heading {
    margin: 0.85rem 0 0.45rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(200, 215, 255, 0.95);
}

.sop-media-videos,
.sop-media-qr {
    margin-top: 0.5rem;
    width: 100%;
}

.sop-media-list {
    margin: 0;
    padding-left: 1.15rem;
}

.sop-media-list li {
    margin: 0.35rem 0;
    line-height: 1.4;
}

.sop-media-link {
    color: #9ec1ff;
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-word;
}

.sop-media-link:hover,
.sop-media-link:focus {
    color: #c9d9ff;
}

.sop-media-meta {
    color: rgba(200, 210, 235, 0.65);
    font-size: 0.85em;
}

.sop-media-missing {
    color: rgba(255, 200, 140, 0.95);
    font-style: italic;
}

.sop-body a.sop-media-link {
    font-weight: 500;
}

/* narrow: stack images */
@media (max-width: 720px) {
    .sop-images {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
    }

    .sop-image-ref {
        width: 100%;
        max-width: 100%;
    }

    .sop-hero.message-image,
    .sop-image-ref img.sop-hero {
        width: 100%;
        max-width: 100%;
        height: auto;
    }
}

/* full height — no clip (overrides style.css .sop-hero max-height/object-fit) */
.sop-hero,
.sop-hero.message-image,
.sop-image-ref img.sop-hero {
    max-height: none !important;
    height: auto !important;
    width: auto;
    max-width: 100%;
    object-fit: contain !important;
    background: transparent !important;
}

@media (max-width: 720px) {
    .sop-hero,
    .sop-hero.message-image,
    .sop-image-ref img.sop-hero {
        width: 100%;
        max-width: 100%;
        height: auto !important;
        max-height: none !important;
        object-fit: contain !important;
    }
}

/* QR: fast bredde 160px (ikke fuld bredde som instruktionsbilleder) */
.sop-image-ref--qr {
    max-width: 160px;
}
.sop-image-ref--qr img.sop-hero,
.sop-image-ref--qr img.sop-qr-image,
.sop-images--qr .sop-image-ref img.sop-hero {
    width: 160px !important;
    max-width: 160px !important;
    height: auto !important;
    max-height: none !important;
}
.sop-qr-link {
    display: inline-block;
    line-height: 0;
}
.sop-image-ref--qr .sop-image-caption {
    max-width: 160px;
}

/* Video: play-knap + beskrivelse under */
.sop-videos {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem 1.25rem;
    margin: 0.35rem 0 0.75rem;
}
.sop-video-card {
    margin: 0;
    padding: 0;
    max-width: 226px;
}
.sop-video-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 226px;
    height: 136px;
    border-radius: 0.75rem;
    background: linear-gradient(145deg, #0a1238, #1e3a8a);
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(10, 18, 56, 0.25);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.sop-video-play:hover,
.sop-video-play:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(10, 18, 56, 0.35);
    outline: none;
}
.sop-video-play-icon {
    display: inline-flex;
    color: #ffffff;
}
.sop-video-play--missing {
    opacity: 0.7;
    font-size: 0.85rem;
    cursor: default;
}
.sop-video-caption {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    line-height: 1.35;
    color: #4a4a4a;
    max-width: 226px;
}
