/* =========================================================
   CLEOPATRA SOCIAL REBUILD
   Beige + Chocolate + Dorado
   Feed con fotos enteras, estilo Instagram
   ========================================================= */

.cleo-rebuild {
    max-width: 720px;
    margin: 0 auto;
    font-family: inherit;
    color: #5A3A2E;
}

.cleo-rebuild [hidden] {
    display: none !important;
}


/* =========================================================
   BOTONES (estilo común)
   ========================================================= */

.cleo-tab,
.cleo-pick,
.cleo-publish,
.cleo-confirm,
.cleo-load-more,
.cleo-like,
.cleo-comment-toggle,
.cleo-comment-form button[type="submit"],
.cleo-reply-form button[type="submit"],
.cleo-edit-form button {
    border: 1px solid #5A3A2E;
    background: #E9D8BE;
    color: #5A3A2E;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.2;
    transition: background 0.2s ease;
}

.cleo-tab:hover,
.cleo-pick:hover,
.cleo-publish:hover,
.cleo-confirm:hover,
.cleo-load-more:hover,
.cleo-like:hover,
.cleo-comment-toggle:hover,
.cleo-comment-form button[type="submit"]:hover,
.cleo-reply-form button[type="submit"]:hover,
.cleo-edit-form button:hover {
    background: #DEC7A8;
}

.cleo-rebuild button:disabled {
    opacity: 0.55;
    cursor: wait;
}


/* =========================================================
   COMPOSITOR
   ========================================================= */

.cleo-composer {
    padding: 18px;
    border: 1px solid #D8C5AD;
    border-radius: 14px;
    margin-bottom: 24px;
    background: #fff;
    box-sizing: border-box;
}

.cleo-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.cleo-tab.is-active {
    font-weight: 700;
    background: #DEC7A8;
}

.cleo-caption {
    width: 100%;
    min-height: 90px;
    box-sizing: border-box;
    border: 1px solid #D8C5AD;
    border-radius: 10px;
    padding: 10px;
    resize: vertical;
    font-family: inherit;
    color: #5A3A2E;
    background: #FFFDF9;
}

.cleo-caption:focus {
    outline: none;
    border-color: #5A3A2E;
}

.cleo-composer .cleo-emoji-wrap {
    margin: 6px 0;
}

.cleo-counter {
    font-size: 12px;
    text-align: right;
    margin: 4px 0 12px;
    color: #8A7064;
}

.cleo-publish {
    font-weight: 700;
}

.cleo-status {
    margin-top: 10px;
    color: #5A3A2E;
    font-size: 13px;
}

.cleo-file-input {
    display: none;
}


/* =========================================================
   EDITOR / RECORTE
   ========================================================= */

.cleo-editor {
    margin-top: 16px;
}

.cleo-editor-preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    background: #F5F0E8;
    border-radius: 8px;
}

.cleo-editor-preview img {
    display: block;
    max-width: 100%;
}

.cleo-controls {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}

.cleo-controls label {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 8px;
    align-items: center;
}

.cleo-controls input[type="range"] {
    accent-color: #5A3A2E;
}

.cleo-confirm {
    display: block;
    width: 100%;
    padding: 13px 18px;
    font-size: 15px;
    font-weight: 700;
}


/* =========================================================
   FOTOS PENDIENTES
   ========================================================= */

.cleo-pending {
    margin: 12px 0;
}

.cleo-pending-item img {
    border-radius: 8px;
    display: block;
}

.cleo-pending-remove {
    position: absolute;
    right: 3px;
    top: 3px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid #5A3A2E;
    border-radius: 50%;
    background: #E9D8BE;
    color: #5A3A2E;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}


/* =========================================================
   PUBLICACIÓN
   ========================================================= */

.cleo-post {
    border: 1px solid #E1D5C6;
    border-radius: 14px;
    margin-bottom: 20px;
    background: #fff;
}

.cleo-post-header {
    padding: 12px 14px;
}

.cleo-post-author {
    color: #5A3A2E;
}

.cleo-post-text {
    padding: 8px 14px 16px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 17px;
    line-height: 1.5;
}

.cleo-post-caption {
    padding: 12px 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}


/* =========================================================
   FOTOS Y CARRUSEL (enteras, centradas)
   ========================================================= */

.cleo-post-media {
    scrollbar-width: none;
}

.cleo-post-media::-webkit-scrollbar {
    display: none;
}

/*
   Cada foto se ve entera. El marco es como mínimo un cuadrado:
   - Horizontal: queda centrada y el resto del cuadrado es de color de fondo.
   - Vertical: se ve entera, hasta un máximo de 4:5 (como Instagram).
*/

.cleo-post-media-item {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    background: #F5F0E8;
    container-type: inline-size;
}

.cleo-post-media-item img {
    max-height: 900px;      /* respaldo para navegadores antiguos */
    max-height: 125cqw;     /* 4:5 respecto al ancho */
    object-fit: contain;
    object-position: center center;
}

.cleo-carousel-prev,
.cleo-carousel-next {
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 1px solid #5A3A2E;
    border-radius: 50%;
    background: #E9D8BE;
    color: #5A3A2E;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 1px 4px rgba(90, 58, 46, 0.15);
}

.cleo-carousel-prev:hover,
.cleo-carousel-next:hover {
    background: #DEC7A8;
}


/* =========================================================
   ACCIONES: LIKE Y COMENTARIOS
   ========================================================= */

.cleo-post-actions {
    padding: 12px 14px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.cleo-like.is-liked {
    font-weight: 700;
    color: #B8862B;
    border-color: #B8862B;
    background: #F6EBD3;
}


/* =========================================================
   COMENTARIOS
   ========================================================= */

.cleo-comments {
    padding: 4px 14px 14px;
    border-top: 1px solid #F0E6D8;
}

.cleo-comment {
    padding: 8px 0;
}

.cleo-comment-author {
    margin-right: 4px;
}

.cleo-comment-text {
    overflow-wrap: anywhere;
}

.cleo-comment-actions {
    display: flex;
    gap: 12px;
    margin-top: 2px;
}

.cleo-comment-actions button {
    border: 0;
    background: none;
    padding: 0;
    font-family: inherit;
    font-size: 12px;
    color: #8A7064;
    cursor: pointer;
}

.cleo-comment-actions button:hover {
    color: #5A3A2E;
    text-decoration: underline;
}

.cleo-replies {
    border-left: 2px solid #E9D8BE;
    padding-left: 10px;
}

.cleo-comment-form,
.cleo-reply-form,
.cleo-edit-form {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
}

.cleo-comment-form input[type="text"],
.cleo-reply-form input[type="text"],
.cleo-edit-form input[type="text"] {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid #D8C5AD;
    border-radius: 8px;
    padding: 8px 10px;
    font-family: inherit;
    color: #5A3A2E;
    background: #FFFDF9;
}

.cleo-comment-form input[type="text"]:focus,
.cleo-reply-form input[type="text"]:focus,
.cleo-edit-form input[type="text"]:focus {
    outline: none;
    border-color: #5A3A2E;
}

.cleo-comments-empty,
.cleo-comments-loading,
.cleo-comments-error,
.cleo-comments-login {
    color: #8A7064;
    font-size: 14px;
    padding: 6px 0;
}

.cleo-comments-login a {
    color: #5A3A2E;
    font-weight: 700;
}


/* =========================================================
   EMOJIS
   ========================================================= */

.cleo-emoji-toggle {
    border: 1px solid #D8C5AD;
    background: #FFFDF9;
    border-radius: 8px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.cleo-emoji-toggle:hover {
    background: #F3E9D9;
}

.cleo-emoji-option:hover {
    background: #F3E9D9 !important;
    border-radius: 6px;
}


/* =========================================================
   ESTADOS DEL FEED
   ========================================================= */

.cleo-loading,
.cleo-feed-empty,
.cleo-feed-end,
.cleo-feed-error {
    padding: 20px;
    text-align: center;
    color: #8A7064;
}

.cleo-load-more {
    display: block;
    margin: 0 auto 24px;
    padding: 10px 20px;
    font-weight: 700;
}


/* =========================================================
   MÓVIL
   ========================================================= */

@media (max-width: 600px) {

    .cleo-rebuild {
        width: 100%;
        max-width: 100%;
    }

    .cleo-composer {
        border-radius: 10px;
        padding: 14px;
    }

    .cleo-post {
        border-radius: 10px;
    }

    .cleo-carousel-prev,
    .cleo-carousel-next {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }
}


/* =========================================================
   FASE 7 — GUARDADOS Y CARPETAS
   ========================================================= */

.cleo-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.cleo-nav-btn,
.cleo-save,
.cleo-folders-toggle,
.cleo-chip,
.cleo-folder-new button {
    border: 1px solid #5A3A2E;
    background: #E9D8BE;
    color: #5A3A2E;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.2;
    transition: background 0.2s ease;
}

.cleo-nav-btn:hover,
.cleo-save:hover,
.cleo-folders-toggle:hover,
.cleo-chip:hover,
.cleo-folder-new button:hover {
    background: #DEC7A8;
}

.cleo-nav-btn.is-active,
.cleo-chip.is-active {
    font-weight: 700;
    background: #DEC7A8;
}

.cleo-save.is-saved {
    font-weight: 700;
    color: #B8862B;
    border-color: #B8862B;
    background: #F6EBD3;
}

.cleo-saved-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
}

.cleo-folder-tools {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

.cleo-folder-tools button {
    border: 0;
    background: none;
    padding: 0;
    font-family: inherit;
    font-size: 12px;
    color: #8A7064;
    cursor: pointer;
}

.cleo-folder-tools button:hover {
    color: #5A3A2E;
    text-decoration: underline;
}

.cleo-folder-panel {
    margin: 0 14px 12px;
    padding: 12px;
    border: 1px solid #E1D5C6;
    border-radius: 10px;
    background: #FFFDF9;
}

.cleo-folder-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    cursor: pointer;
}

.cleo-folder-item input {
    accent-color: #5A3A2E;
}

.cleo-folder-item small {
    color: #8A7064;
}

.cleo-folder-new {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.cleo-folder-new input[type="text"] {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid #D8C5AD;
    border-radius: 8px;
    padding: 8px 10px;
    font-family: inherit;
    color: #5A3A2E;
    background: #fff;
}

.cleo-folder-new input[type="text"]:focus {
    outline: none;
    border-color: #5A3A2E;
}

/* =========================
   MENSAJES — BOTÓN ENVIAR
   ========================= */

#cleo-dm-send {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #E9D8BE;
    color: #4A2C1A;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 18px;
    line-height: 1;
}

#cleo-dm-send:hover {
    background: #DCC5A5;
}

#cleo-dm-send:active {
    transform: scale(0.95);
}

#cleo-dm-send:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Botón enviar de mensajes */
#cleo-dm-send {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #E9D8BE;
    color: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 0;
    line-height: 1;
}

#cleo-dm-send::before {
    content: "";
    width: 22px;
    height: 22px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' fill='none' stroke='%234A2C1A' stroke-width='22' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='125' y='137' width='366' height='236' rx='22'/%3E%3Cpath d='M131 185 L314 300 L491 185 M131 322 L237 258 M491 322 L403 258 M7 195 H125 M26 235 H44 M64 235 H118 M26 277 H118 M46 317 H64 M84 317 H118'/%3E%3C/svg%3E") center / contain no-repeat;
}

#cleo-dm-send:hover {
    background: #DCC5A5;
}

#cleo-dm-send:active {
    transform: scale(0.95);
}