body {
    background: #f5f0e8;
    color: #222;
    font-family: Georgia, serif;
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.post {
    border-bottom: 1px solid #bbb;
    padding: 12px 0;
}

.date {
    font-size: 13px;
    color: #888;
    margin-bottom: 6px;
}

p {
    margin: 0 0 6px 0;
    line-height: 1.6;
    overflow-wrap: break-word;
}

video,
img {
    max-width: 100%;
    margin-top: 8px;
    display: block;
}

img + img {
    margin-top: 4px;
}

/* ---- Reproductor de audio a tono con el blog ---- */
.audio-player {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 8px 10px;
    background: #efe8dc;
    border: 1px solid #bbb;
    box-sizing: border-box;
}

.audio-player .ap-play {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 11px;
    line-height: 1;
    color: #f5f0e8;
    border: 1px solid #8a7d62;
    border-radius: 50%;
    background: #9a8d72;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.audio-player .ap-play:hover {
    background: #8a7d62;
}

.audio-player .ap-play:active {
    transform: scale(0.92);
}

.audio-player .ap-bar {
    flex: 1 1 auto;
    min-width: 0;
    height: 16px;
    display: block;
    cursor: pointer;
    overflow: visible;
}

.audio-player .ap-track,
.audio-player .ap-fill {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.audio-player .ap-track {
    stroke: #ddd5c6;
}

.audio-player .ap-fill {
    stroke: #9a8d72;
}

.audio-player .ap-time {
    flex: 0 0 auto;
    font-size: 12px;
    color: #888;
    font-variant-numeric: tabular-nums;
    min-width: 34px;
    text-align: right;
}

.audio-player .ap-vol-btn {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: none;
    color: #9a8d72;
    cursor: pointer;
}

.audio-player .ap-vol-btn:hover {
    color: #8a7d62;
}

.audio-player .ap-vol {
    flex: 0 0 auto;
    width: 46px;
    height: 6px;
    background: #ddd5c6;
    border: 1px solid #bbb;
    cursor: pointer;
    position: relative;
}

.audio-player .ap-vol-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: #9a8d72;
}

/* En pantallas muy angostas escondemos la barrita de volumen (queda el botón de silencio) */
@media (max-width: 400px) {
    .audio-player .ap-vol {
        display: none;
    }
}

/* ---- Reproductor de canción: portada + nombre, reusa .audio-player ---- */
.song-player {
    align-items: stretch;
    gap: 12px;
}

.song-player .sp-cover {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ddd5c6 center / cover no-repeat;
    border: 1px solid #bbb;
    color: #9a8d72;
    font-size: 22px;
}

.song-player .sp-cover.has-cover .sp-cover-ph {
    display: none;
}

.song-player .sp-cover-ph-profile {
    display: flex;
    width: 100%;
    height: 100%;
}

.song-player .sp-cover-ph-profile svg {
    width: 100%;
    height: 100%;
    display: block;
}

.song-player .sp-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.song-player .sp-name {
    font-size: 13px;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-player .sp-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

iframe {
    width: 100%;
    height: 500px;
    margin-top: 8px;
    border: 1px solid #bbb;
}

footer {
    font-size: 11px;
    color: #aaa;
    text-align: center;
    margin-top: 30px;
}

/* ---- Barra lateral fija: contiene el mini reproductor y los comentarios ---- */
#sidebar {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 280px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
}

/* ---- Seccion lateral de comentarios ---- */
#comments-aside {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #efe8dc;
    border: 1px solid #bbb;
    padding: 14px;
    font-size: 14px;
    box-sizing: border-box;
}

/* ---- Mini reproductor que sigue sonando, en su propia tarjeta ---- */
/* Reutiliza los estilos de .audio-player; solo agrega el titulo y la tarjeta. */
#mini-player {
    flex: 0 0 auto;
    background: #efe8dc;
    border: 1px solid #bbb;
    padding: 12px 14px;
    box-sizing: border-box;
}

#mini-player[hidden] {
    display: none;
}

#mini-player .mp-title {
    font-size: 11px;
    color: #777;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dentro de la tarjeta, el player es solo la fila de controles (sin su propio recuadro). */
#mini-player .audio-player {
    margin-top: 0;
    background: none;
    border: none;
    padding: 0;
}

#comments-aside h2 {
    font-size: 15px;
    margin: 0 0 10px 0;
    font-weight: normal;
    color: #555;
}

#comment-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

#comment-form input,
#comment-form textarea {
    font-family: Georgia, serif;
    font-size: 13px;
    padding: 6px;
    border: 1px solid #bbb;
    background: #f5f0e8;
    box-sizing: border-box;
}

#comment-form textarea {
    resize: vertical;
    min-height: 50px;
}

#comment-form button {
    font-family: Georgia, serif;
    font-size: 13px;
    padding: 6px;
    border: 1px solid #999;
    background: #e2d9c8;
    cursor: pointer;
}

#comment-form button:disabled {
    opacity: 0.5;
    cursor: default;
}

#comment-status {
    font-size: 12px;
    color: #888;
    min-height: 14px;
}

#comment-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment {
    border-top: 1px solid #ccc;
    padding-top: 8px;
}

.comment .c-author {
    font-weight: bold;
    font-size: 13px;
}

.comment .c-date {
    font-size: 11px;
    color: #999;
    margin-left: 6px;
}

.comment .c-message {
    margin: 4px 0 0 0;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

/* En pantallas angostas no hay lugar al costado: lo mandamos arriba de los posts */
@media (max-width: 1100px) {
    body {
        display: flex;
        flex-direction: column;
    }

    #sidebar {
        position: static;
        width: auto;
        max-height: none;
        margin: 0 0 30px 0;
        order: -1;
    }

    #mini-player {
        display: none !important;
    }

    /* En mobile los comentarios viven en el modal: ocultamos el aside del sidebar. */
    #sidebar #comments-aside {
        display: none;
    }

    #comments-fab {
        display: block !important;
    }

    #comment-list {
        max-height: 400px;
    }
}

/* ---- FAB + modal de comentarios (solo mobile) ---- */
#comments-fab {
    display: none;
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 50;
    font-family: Georgia, serif;
    font-size: 14px;
    padding: 10px 16px;
    border: 1px solid #bbb;
    background: #efe8dc;
    color: #555;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(34, 31, 26, 0.25);
}

#comments-modal {
    position: relative;
    border: 1px solid #bbb;
    background: #f5f0e8;
    color: #222;
    padding: 0;
    width: calc(100vw - 32px);
    max-width: 480px;
    max-height: calc(100vh - 64px);
    box-sizing: border-box;
    overflow-y: auto;
}

#comments-modal::backdrop {
    background: rgba(34, 31, 26, 0.45);
}

#comments-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    font-family: Georgia, serif;
    font-size: 16px;
    line-height: 1;
    border: none;
    background: none;
    color: #8a7d62;
    cursor: pointer;
    padding: 0 2px;
}

#comments-modal #comments-aside {
    border: none;
    background: none;
    padding: 40px 20px 18px;
}

/* ---- Desencriptar canción (key inline en el post) ---- */
#key-modal {
    border: 1px solid #bbb;
    background: #f5f0e8;
    padding: 0;
    color: #222;
}
#key-modal::backdrop {
    background: rgba(34, 31, 26, 0.45);
}
#key-modal .sp-unlock {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 20px;
    min-width: 240px;
}
#key-modal .sp-unlock-title {
    font-family: Georgia, serif;
    font-size: 15px;
    color: #8a7d62;
}
#key-modal .sp-key {
    font-family: Georgia, serif;
    font-size: 14px;
    padding: 6px 8px;
    border: 1px solid #bbb;
    background: #fdfaf4;
}
#key-modal .sp-unlock-actions {
    display: flex;
    gap: 6px;
}
#key-modal .sp-unlock-actions button {
    font-family: Georgia, serif;
    font-size: 15px;
    padding: 5px 12px;
    border: 1px solid #bbb;
    background: #fdfaf4;
    cursor: pointer;
}
#key-modal .sp-unlock-status {
    font-size: 12px;
    color: #888;
    min-height: 14px;
}
.song-player.locked {
    opacity: 0.85;
}

/* === cierre === */
.redacted {
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}
.redacted::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 100%;
    height: calc(100% + 4px);
    background: #111;
    transform-origin: left center;
    animation: redact 1.2s cubic-bezier(0.55, 0, 0.45, 1) forwards;
}
@keyframes redact {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}
img.redacted,
video.redacted {
    filter: brightness(0);
    transition: filter 1.2s cubic-bezier(0.55, 0, 0.45, 1);
}
img.redacted::after,
video.redacted::after {
    display: none;
}

#closure-stamp {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-12deg) scale(2);
    pointer-events: none;
    opacity: 0;
    z-index: 9999;
}
#closure-stamp img {
    display: block;
    width: 200px;
    height: auto;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}
#closure-stamp.stamped {
    animation: stamp 0.25s cubic-bezier(0.17, 0.67, 0.3, 1.33) forwards;
}
@keyframes stamp {
    from { transform: translate(-50%, -50%) rotate(-12deg) scale(2); opacity: 0; }
    to   { transform: translate(-50%, -50%) rotate(-12deg) scale(1); opacity: 0.95; }
}
