:root {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --border: #334155;
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}

/* --- NAVEGACIÓN --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-login {
    background: var(--accent);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border: none;
    cursor: pointer;
}

.btn-login:hover {
    background: var(--accent-hover);
}

/* --- CABECERA SIN MARCO --- */
.hero-header {
    width: 100%;
    padding-top: 80px;
    position: relative;
    display: flex;
    justify-content: center;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

.video-container {
    width: 100%;
    max-width: 1100px;
    height: 480px;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.5);
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.8), transparent);
    pointer-events: none;
}

/* --- PARRILLA DE PUBLICACIONES --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.section-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grid-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* --- EFECTO HOVER EN VIÑETAS --- */
.post-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4);
}

.drag-handle {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 6px;
    border-radius: 6px;
    cursor: grab;
    z-index: 10;
}

.post-media {
    width: 100%;
    height: 200px;
    background: #000;
    position: relative;
}

.post-media img, .post-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.post-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.post-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.btn-action {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.btn-action:hover {
    color: var(--text-main);
}

/* --- ESTILOS DEL MODAL GLOBAL --- */
#globalModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4); 
    backdrop-filter: blur(2px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 2vw;
}

#modalBody {
    width: 90vw !important;          
    max-width: 90vw !important;      
    height: 90vh !important;           
    max-height: 90vh !important;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--bg-card);
}

#modalBody::-webkit-scrollbar {
    width: 8px;
}

#modalBody::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

#modalBody::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 4px;
    border: 2px solid var(--bg-card);
}

#modalBody::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

/* --- CORRECCIÓN PARA RENDERIZAR CONTENIDO QUILL EN EL MODAL --- */
.ql-editor-view img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
}

.ql-editor-view hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
    clear: both;
}

.ql-editor-view p {
    margin-bottom: 1rem;
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

/* --- CONTENEDOR MULTIMEDIA Y TEXTO CORREGIDO --- */
.post-content-container {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
    max-height: 380px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.post-content-container img,
.post-content-container video,
.post-content-container iframe {
    flex: 0 0 35%;
    max-width: 35%;
    max-height: 350px;
    height: auto;
    object-fit: contain;
}

.post-content-container .text-blocks,
.post-content-container > div:not(img):not(video):not(iframe) {
    flex: 1;
    overflow-y: auto;
    max-height: 350px;
}

.post-modal-inner img, 
.post-modal-inner video, 
.post-modal-inner iframe {
    max-width: 35%;
    max-height: 350px;
    height: auto;
    object-fit: contain;
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

/* --- RESPONSIVE MÓVIL --- */
@media (max-width: 768px) {
    .video-container { 
        height: 260px; 
        border-radius: 0; 
    }
    .hero-header { 
        padding-top: 65px; 
    }

    #modalBody {
        width: 90vw !important;
        max-width: 90vw !important;
        height: 90vh !important;
        max-height: 90vh !important;
    }

    .post-modal-inner {
        padding: 1.30rem !important;
        width: 100% !important;
    }

    .post-modal-inner h2 {
        font-size: 1.45rem !important;
        line-height: 1.3;
    }

    .post-modal-inner div p, 
    .post-modal-inner div {
        font-size: 1.10rem !important;
        line-height: 1.5;
    }

    .post-content-container {
        max-height: none;
    }

    .post-content-container img,
    .post-content-container video,
    .post-content-container iframe,
    .post-modal-inner img, 
    .post-modal-inner video, 
    .post-modal-inner iframe {
        max-width: 100%;
        float: none;
        margin-right: 0;
    }
}