/* Importaciones de fuentes */
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap");

/* Variables de colores */
:root {
    --color1: #2b7f87;
    --color2: #65b4b8;
    --color3: #cee5d1;
    --color4: #f3eeec;
    --color5: #e0c198;
    --color6: #ff7878;
    --colorGrisSuave: #EDEDED;
    --verdePastel: #68c45f;
    --color-acento1: #d49a6a;
    --color-acento2: #1fb8a6;
    --color-acento3: #ff5e5e;
    --ui-font: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

html{
    font-family: Montserrat;
}

body{
    background-color: var(--colorGrisSuave);
}

.resaltado2 {
    color: var(--color2);
    text-decoration: none;
}

.resaltado2:hover {
    text-decoration: underline;
}

.linea-separadora{
    border: 0.5px solid rgb(224, 224, 224);
    width: 90%;
    margin: auto;
}

/* --- Estilo para la VISTA GLOBAL de PUBLICACIONES --- */
.btnContinuarLeyendo{
    background-color: var(--colorGrisSuave);
    cursor: pointer;
    border: 2px solid var(--color2);
    padding: 10px 15px;
    text-decoration: none;
    color: black;
    margin: 10px 0px;
    text-align: left;
    max-width: 200px;
    transition: background-color 0.3s, color 0.3s;
}

.btnContinuarLeyendo:hover{
    background-color: var(--color2);
    color: white;
}


.blog-main{
    width: 100%;
    background-color: white;
}

.blog-header{
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    padding: 20px 10px;
}

@media (max-width: 446px) {
    .blog-header{
        flex-direction: column;
        gap: 10px;
    }
}


.blog-container-aside{
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
}

.blog-container {
    background-color: white;
    width: 70%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 50px;
}


.post-card {
    width: 100%;
    max-width: 700px;
    background-color: transparent;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    padding: 20px 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
}

.post-image {
    width: fit-content;
    max-width: 100%;
    height: auto;
    display: block;
}

/* Vista desde el index */

.post-body{
    width: 100%;
    padding: 20px 10px;
    text-align: justify;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    gap: 10px;
}

.post-title,
.post-subtitle,
.post-body {
    text-align: justify;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.post-title{
    font-size: 18px;
}

.post-subtitle{
    font-size: 16px;
}
.post-info{
    color: rgb(141, 141, 141);
    font-size: 14px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

/* --- Estilos para la VISTA INDIVIDUAL de cada PUBLICACION --- */

.post-main-container {
    display: flex;
    align-items: flex-start;
    width: 100%;
    min-height: 70vh;
    background-color: var(--color4);
    gap: 30px; /* separación entre contenido y aside */
}

.post-container {
    width: 80%;
    min-height: 70vh;
    flex: 1;       
    padding: 20px;
    background-color: white;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.img-post-content{
    width: 100%;
    height: 300px;        /* altura fija */
    object-fit: cover;    /* recorta manteniendo proporción */
    object-position: center;  /* centra el recorte */
    border-radius: 6px;   /* opcional */
    display: block;
}


/* --- ASIDE --- */
.index-aside {
    width: 30%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 5px 20px;  
    position: sticky !important;
    top: 0 !important;
}

/* Títulos de las secciones */
.aside-title {
    width: 100%;
    text-align: center;
    background-color: var(--colorGrisSuave);
    padding: 6px 10px;
    font-weight: bold;
}

/* Lista contenedora */

.post-admin-options{
    display: flex;
    flex-direction: row;
    gap: 5px;
    justify-content: space-evenly;
    margin: auto;
    width: 100%;
}

@media (max-width: 600px) {
    .post-admin-options{
        flex-direction: column;
    }
}

.post-aside-list {
    width: 100%;
    list-style: none;
    padding: 0;
    margin: 0;

    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Links */
.post-aside-link {
    display: block;
    width: 100%;

    text-decoration: none;
    color: black;
    line-height: 1.5;
}

/* Hover */
.post-aside-link:hover {
    text-decoration: underline;
}

/* Línea separadora */
.linea-separadora {
    width: 90%;
    border: none;
    border-bottom: 1px solid #ddd;
    margin: 5px auto;
}

/* ESCONDEMOS PARA TELEFONO EL ASIDE  */
@media (max-width: 600px) {

    .post-container{
        width: 100%;
    }
    /* El contenedor pasa a UNA sola columna */
    .blog-container-aside {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    /* Contenido ocupa el 100% */
    .blog-container {
        width: 100%;
    }

    /* Ajuste del layout principal */
    .blog-main {
        width: 100%;
        margin: auto;
    }

    /* EL ASIDE AHORA APARECE DEBAJO */
    .index-aside {
        width: 95%;
        position: static;       /* Quita el sticky */
        padding: 10px 0;
    }
}

/* --- ESTILOS DE BASE PANEL PARA CREARCION Y MODIFICACION DE ARTICULOS */

.admin-header {
    width: 80%;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff; /* Azul estilo Bootstrap */
    padding: 15px 25px;
    color: black;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.admin-header h1 {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
}

.admin-nav ul {
    list-style: none;
    display: flex;
    flex-direction: row;
    gap: 15px; /* separación uniforme */
    margin: 0;
    padding: 0;
}

.admin-nav ul li a {
    text-decoration: none;
    transition: 0.2s;
}

@media (max-width: 620px) {
    .admin-header{
        flex-direction: column;
    }
    .admin-nav ul{
        gap: 5px;
        flex-direction: column;
    }
    .admin-nav ul li a {
        font-size: 14px;
    }
}


/* BOTÓN AZUL (Aceptar) */
.botonAzul {
    background-color: #007BFF;
    border: 2px solid #007BFF;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    width: 100%;
    max-width: 300px;
}

.botonAzul:hover {
    background-color: transparent;
    color: #007BFF;
}

/* BOTÓN ROJO (Cancelar) */
.botonRojo {
    background-color: #D9534F;
    border: 2px solid #D9534F;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    width: 100%;
    max-width: 300px;
}

.botonRojo:hover {
    background-color: transparent;
    color: #D9534F;
}

.btn-share{
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start; /* mejor que space-between para el icono + texto */
    background-color: white;
    border: 2px solid var(--color2);
    padding: 10px 15px;
    text-decoration: none;
    color: black;
    margin: 10px 0px;
    min-width: 250px;
    width: 30%;
    text-align: left;
    transition: background-color 0.3s, color 0.3s;
    gap: 10px; /* espacio entre icono y texto */
}

.btn-share img {
    flex-shrink: 0; /* evita que el icono se comprima */
}

.btn-share:hover, .btn-share:active{
    background-color: var(--color2);
    color: white;
}

@media (max-width: 361px) {
    .btn-share{
        min-width: 0 !important;
        width: 100% !important; /* ocupa todo el contenedor */
        flex-wrap: wrap; /* permite que el texto baje si es necesario */
    }
}

/* ================================
   FORMULARIOS DEL PANEL (SEGURO)
================================ */

.form-modificar-crear {
    width: 80%;
    max-width: 900px;
    margin: 40px auto;
    background-color: white;
    padding: 30px 35px;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Títulos */
.form-modificar-crear h2 {
    font-size: 22px;
    margin-bottom: 10px;
}

/* Formulario */
.form-modificar-crear form {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    gap: 15px;
}

/* Inputs generados por Django */
.form-modificar-crear input[type="text"],
.form-modificar-crear textarea,
.form-modificar-crear input[type="file"] {
    width: 90%;
    margin: auto;
    padding: 12px;
    border: 1px solid var(--color2);
    border-radius: 6px;
    background-color: var(--color4);
    font-family: var(--ui-font);
    font-size: 15px;
}

/* Botón general */
.form-modificar-crear button,
.form-modificar-crear .btn-primary {
    background-color: var(--color-acento2);
    border: 2px solid var(--color-acento2);
    color: white;
    padding: 12px 18px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.form-modificar-crear button:hover,
.form-modificar-crear .btn-primary:hover {
    background-color: transparent;
    color: var(--color-acento2);
}

/* Enlace Volver */
.btn-volver{
    margin-left: 20px;
    align-self: flex-start;
    text-decoration: underline !important;
}
.form-modificar-crear a, .btn-volver {
    text-decoration: none;
    color: var(--color-acento2);
    font-size: 16px;
}

.form-modificar-crear a:hover, .btn-volver:hover {
    text-decoration: underline;
}

/* Imagen actual */
.form-modificar-crear img {
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    margin-top: 10px;
}

/* ===== ESTILOS FORMATEADOS PARA EL POST ===== */
/* --- ESTILOS PARA EL CONTENIDO DE SUMMERNOTE --- */

/* Ajustamos el contenedor para que el texto fluya natural */
.post-content {
    text-align: left; /* O justify, según prefieras */
    line-height: 1.8;
    color: #333;
}

/* Títulos dentro del post */
.post-content h1, .post-content h2, .post-content h3, 
.post-content h4, .post-content h5, .post-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.post-content h1 { font-size: 2.2rem; }
.post-content h2 { font-size: 1.8rem; }
.post-content h3 { font-size: 1.5rem; }

/* Párrafos y espaciado */
.post-content p {
    margin-bottom: 1rem;
}

/* Negritas e itálicas (asegurar que se vean) */
.post-content b, .post-content strong {
    font-weight: bold;
}

.post-content i, .post-content em {
    font-style: italic;
}

/* La línea separadora <hr> */
.post-content hr {
    border: 0;
    border-top: 2px solid var(--color2);
    margin: 2rem 0;
}

/* Listas (por si ocupas viñetas) */
.post-content ul, .post-content ol {
    margin-left: 20px;
    margin-bottom: 1rem;
}

/* Imágenes dentro del contenido */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 10px auto;
}