/* =========================================================
   StreamField blocks (audio, video, image, lightbox, button, wrap)
   ========================================================= */

/* ===== Audio (Clean Pro Card + Equalizer) ===== */
.aa-audio {
    display: flex;
    gap: 14px;
    align-items: stretch;
    padding: 14px 16px;
    margin: 18px 0;
    border: 1px solid rgba(12, 25, 45, .10);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .05);
}

.aa-audio__play {
    flex: 0 0 auto;
    width: 34px; /* Smaller */
    height: 34px;
    border-radius: 50%;
    background: rgba(22, 119, 255, 0.1); /* Lighter bg */
    border: none;
    color: #1677ff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aa-audio__play:hover {
    background: #1677ff;
    color: #fff;
    transform: scale(1.05);
}

.aa-audio__play:active {
    transform: scale(0.95);
}

.aa-audio__play-icon {
    font-weight: 900;
    font-size: 10px; /* Smaller icon */
    line-height: 1;
    margin-left: 2px; /* visual center fix */
    width: 1em;
    text-align: center;
}

.aa-audio__content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aa-audio__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.aa-audio__title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-weight: 850;
    color: #0b1320;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aa-audio__time {
    flex: 0 0 auto;
    font-size: 12px;
    color: rgba(11, 19, 32, .58);
    white-space: nowrap;
}

.aa-audio__sep {
    opacity: .6;
    margin: 0 6px;
}

.aa-audio__bar {
    display: flex;
    align-items: center;
}

.aa-audio__range {
    width: 100%;
    height: 6px;
    accent-color: #1677ff;
}

.aa-audio__range::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(12, 25, 45, .10);
}

.aa-audio__range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -4px;
    border-radius: 999px;
    background: #1677ff;
    border: 2px solid #fff;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .12);
}

.aa-audio__range::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(12, 25, 45, .10);
}

.aa-audio__range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #1677ff;
    border: 2px solid #fff;
}

.aa-audio__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aa-audio__download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%; /* Circle */
    border: 1px solid transparent;
    background: transparent;
    color: #64748b; /* Neutral gray */
    transition: all 0.2s ease;
    cursor: pointer;
}

.aa-audio__download:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #0b1320;
    transform: scale(1.05);
}

.aa-audio__download:active {
    transform: scale(0.95);
}

/* Equalizer */
.aa-audio__eq {
    display: inline-flex;
    align-items: flex-end;
    gap: 3px;
    height: 12px;
    opacity: .75;
    flex: 0 0 auto;
}

.aa-audio__eq i {
    display: block;
    width: 2px;
    height: 4px;
    border-radius: 2px;
    background: rgba(11, 19, 32, .45);
    transform-origin: bottom;
}

.aa-audio.is-playing .aa-audio__eq i {
    background: rgba(22, 119, 255, .75);
    animation: aaEq 900ms ease-in-out infinite;
}

.aa-audio.is-playing .aa-audio__eq i:nth-child(2) {
    animation-delay: 80ms;
}

.aa-audio.is-playing .aa-audio__eq i:nth-child(3) {
    animation-delay: 160ms;
}

.aa-audio.is-playing .aa-audio__eq i:nth-child(4) {
    animation-delay: 240ms;
}

.aa-audio.is-playing .aa-audio__eq i:nth-child(5) {
    animation-delay: 320ms;
}

.aa-audio.is-playing .aa-audio__eq i:nth-child(6) {
    animation-delay: 400ms;
}

.aa-audio.is-playing .aa-audio__eq i:nth-child(7) {
    animation-delay: 480ms;
}

.aa-audio.is-playing .aa-audio__eq i:nth-child(8) {
    animation-delay: 560ms;
}

.aa-audio.is-playing .aa-audio__eq i:nth-child(9) {
    animation-delay: 640ms;
}

.aa-audio.is-playing .aa-audio__eq i:nth-child(10) {
    animation-delay: 720ms;
}

@keyframes aaEq {
    0% {
        height: 3px;
    }

    20% {
        height: 10px;
    }

    40% {
        height: 5px;
    }

    60% {
        height: 12px;
    }

    80% {
        height: 6px;
    }

    100% {
        height: 3px;
    }
}

@media (max-width: 520px) {
    .aa-audio {
        padding: 12px 12px;
        gap: 12px;
    }

    .aa-audio__play {
        width: 48px;
        min-width: 48px;
        height: 48px;
    }

    .aa-audio__top {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* ===== Video (16:9) ===== */
.aa-video-card {
    margin: 18px 0;
}

.aa-video-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(12, 25, 45, .10);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .06);
}

.aa-video-embed iframe,
.aa-video-embed embed,
.aa-video-embed object {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
}

/* ===== Image card + click zoom ===== */
.aa-img-card {
    margin: 18px 0;
    border-radius: 14px;
    overflow: hidden;
    background: #f3f6fb;
    border: 1px solid rgba(12, 25, 45, .10);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .06);
}

.aa-img-card img {
    width: 100%;
    height: auto;
    display: block;
}

.aa-img-zoom {
    cursor: zoom-in;
}

/* ===== Lightbox ===== */
.aa-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(6px);
}

.aa-lightbox.is-open {
    display: flex;
}

.aa-lightbox__panel {
    position: relative;
    width: min(1200px, 96vw);
    height: min(86vh, 900px);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 24px 90px rgba(0, 0, 0, .45);
}

.aa-lightbox__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    cursor: zoom-out;
}

.aa-lightbox__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(0, 0, 0, .35);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.aa-lightbox__close:hover {
    background: rgba(0, 0, 0, .45);
}

/* ===== Button ===== */
.aa-btn-wrap {
    margin: 16px 0;
}

.aa-btn-align-left {
    text-align: left;
}

.aa-btn-align-center {
    text-align: center;
}

.aa-btn-align-right {
    text-align: right;
}

.aa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    font-weight: 800;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform .05s ease, background .15s ease, border-color .15s ease, filter .15s ease;
    user-select: none;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    background-color: var(--btn-bg, #00263e);
    border-color: var(--btn-bg, #00263e);
    color: var(--btn-color, #ffffff) !important;
}

.aa-btn:hover {
    filter: brightness(1.3);
}

.aa-btn:active {
    transform: translateY(1px);
}

.aa-btn-sm {
    padding: 8px 12px;
    font-size: 13px;
}

.aa-btn-md {
    padding: 10px 16px;
    font-size: 14px;
}

.aa-btn-lg {
    padding: 12px 18px;
    font-size: 15px;
}

.aa-btn-block {
    display: flex;
    width: 100%;
}

.aa-btn-primary {
    background: #1677ff;
    color: #fff;
}

.aa-btn-primary:hover {
    background: #0f66e6;
}

.aa-btn-secondary {
    background: #0b1320;
    color: #fff;
}

.aa-btn-secondary:hover {
    background: #050a12;
}

.aa-btn-success {
    background: #16a34a;
    color: #fff;
}

.aa-btn-success:hover {
    background: #138a3f;
}

.aa-btn-warning {
    background: #f59e0b;
    color: #0b1320;
}

.aa-btn-warning:hover {
    background: #e28f08;
}

.aa-btn-danger {
    background: #ef4444;
    color: #fff;
}

.aa-btn-danger:hover {
    background: #dc3c3c;
}

.aa-btn-dark {
    background: #111827;
    color: #fff;
}

.aa-btn-dark:hover {
    background: #0b1220;
}

.aa-btn-outline {
    background: transparent;
    color: #1677ff;
    border-color: rgba(22, 119, 255, .35);
}

.aa-btn-outline:hover {
    background: rgba(22, 119, 255, .08);
    border-color: rgba(22, 119, 255, .45);
}

.aa-btn-link {
    background: transparent;
    color: #1677ff;
    border-color: transparent;
    padding-left: 0;
    padding-right: 0;
}

.aa-btn-link:hover {
    text-decoration: underline;
}

/* ===== Image + Text wrap ===== */
.aa-wrap {
    margin: 18px 0;
    color: rgba(11, 19, 32, .86);
    font-size: 17px;
    line-height: 1.75;
}

.aa-wrap__media {
    width: 320px;
    max-width: 44%;
    /* background: #f3f6fb; removed */
    /* border: 1px solid rgba(12, 25, 45, .10); removed */
    /* box-shadow: 0 14px 40px rgba(0, 0, 0, .06); removed */
    overflow: hidden;
}

.aa-wrap__media img {
    width: 100%;
    height: auto;
    display: block;
}

.aa-wrap--right .aa-wrap__media {
    float: right;
    margin: 4px 0 12px 16px;
}

.aa-wrap--left .aa-wrap__media {
    float: left;
    margin: 4px 16px 12px 0;
}

.aa-wrap--sm .aa-wrap__media {
    width: 240px;
}

.aa-wrap--md .aa-wrap__media {
    width: 320px;
}

.aa-wrap--lg .aa-wrap__media {
    width: 420px;
    max-width: 52%;
}

.aa-wrap--rounded .aa-wrap__media {
    border-radius: 16px;
}

.aa-wrap--soft .aa-wrap__media {
    border-radius: 12px;
}

.aa-wrap--square .aa-wrap__media {
    border-radius: 0;
}

.aa-wrap::after {
    content: "";
    display: block;
    clear: both;
}

@media (max-width: 760px) {
    .aa-wrap__media {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 12px 0 !important;
        border-radius: 14px;
    }
}
