/* Prevención de overflow horizontal */
* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

.blog{
    width: 100%;
    justify-items: center;
    color:#01013a
}
.titulo, .subtitulo{
    padding-left: 10%;
}
.posts{
    margin-top: 20px;
    width: 100%;
    margin-bottom: 20px;
    max-width: 1000px;
    justify-self: center;
    display: flex;
    gap: 20px;
    flex-direction: column;
}
.post_a{
    text-decoration: none;
    color: black;
    height: auto;
    box-sizing: border-box;
    display: block;
}
.post_preview{
    display: flex;
    align-items: center;
    height: 150px;
}
.post_preview img{
    width: 250px;
    min-width: 250px;
    height: 150px;
    min-height: 150px;
    object-fit: cover;
}
.post_preview_content{
    padding-left: 10px;
    display: flex;
    flex-direction: column;
}
.post_preview_content h3{
    margin: 0;
}
.post_preview_content p{    
    white-space: break-spaces;       
    overflow: hidden;          
    text-overflow: ellipsis;
}

.search{
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    background-image: url('/static/img/fondo.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    position: relative;
}

.search::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.search > * {
    position: relative;
    z-index: 2;
}
#search-input {
    width: 70vw;
    height: fit-content;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

#results .post {
    margin-bottom: 10px;
}

#results .post a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
}

#results .post a:hover {
    text-decoration: underline;
    color: #007BFF;
}


.content{
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
}
.post{
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: center;
    max-width: 1000px;
    width: 100%;
    align-items: center;
    margin-top: 30px;
    padding: 0 15px;
    box-sizing: border-box;
}
.post_content{
    width: 100%;
    max-width: 800px;
    text-align: justify;
    padding: 0 15px;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.post_content * {
    max-width: 100%;
    box-sizing: border-box;
}

.post_content img {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: cover;
}

.post_content table {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
}

.post_content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
}
.post .portada{
    max-width: 100%;
    width: 100%;
    height: auto;
    max-height: 400px;
    aspect-ratio: 16 / 7;
    object-fit: cover;
}
.post img{
    max-width: 100%;
    max-height: 400px;
    object-fit: cover;
    height: auto;
}

.post h4{
    margin-bottom: 0px;
}
.share-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;  
    margin-bottom: 30px;
}

.share-button {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
    border-radius: 50%;
    padding: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    text-decoration: none;
}
.share-button svg {
    color: black;
}

.share-button:hover {
    transform: scale(1.1);
    background-color: #ddd;
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
}
.share-button.facebook:hover {
    background-color: #7fb6ff;
}
.share-button.twitter:hover {
    background-color: #4b4b4b;
}
.share-button.linkedin:hover {
    background-color: #83d4ff;
}
.share-button.whatsapp:hover {
    background-color: #82f9ae;
}


.tags{
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 30px;
}
.tag{
    border: 1px solid rgba(0, 0, 0, 0.138);
    background-color: #e4e4ea;
    border-radius: 5px;
    padding: 5px;
}


/* Responsive Design */

/* Tablets y pantallas medianas (768px - 1024px) */
@media (max-width: 1024px) {
    .content {
        padding: 0 10px;
    }
    
    .post {
        padding: 0 10px;
        max-width: 95%;
    }
    
    .post_content {
        width: 100%;
        padding: 0 10px;
    }
    
    .posts {
        max-width: 90%;
        padding: 0 20px;
    }
    
    .post_preview img {
        width: 200px;
        min-width: 200px;
        height: 120px;
        min-height: 120px;
    }

    .search {
        height: 180px;
    }
}

/* Tablets pequeños (600px - 768px) */
@media (max-width: 768px) {
    .content {
        padding: 0 5px;
    }
    
    .post {
        padding: 0 5px;
        max-width: 100%;
        margin-top: 20px;
    }
    
    .post_preview {
        flex-direction: column;
        height: auto;
        gap: 10px;
    }
    
    .post_preview img {
        width: 100%;
        min-width: auto;
        height: 200px;
        min-height: auto;
    }
    
    .post_preview_content {
        padding-left: 0;
        width: 100%;
    }
    
    .search {
        height: 160px;
    }
    
    .search #search-input {
        width: 85vw;
    }
}

/* Móviles (hasta 600px) */
@media (max-width: 600px) {
    .content {
        padding: 0;
    }
    
    .post {
        padding: 0 10px;
        margin-top: 15px;
        max-width: 100%;
        gap: 15px;
    }
    
    .titulo, .subtitulo {
        padding-left: 5%;
        padding-right: 5%;
    }
    
    .posts {
        padding: 0 15px;
        gap: 15px;
    }
    
    .post_preview {
        flex-direction: column;
        height: auto;
    }
    
    .post_preview img {
        width: 100%;
        height: 180px;
        object-fit: cover;
    }
    
    .post_preview_content {
        width: 100%;
        padding: 10px 0;
    }
    
    .post_content {
        width: 100%;
        padding: 0 15px;
    }
    
    .post_content iframe {
        width: 100%;
        height: auto;
    }
    
    .post .portada {
        max-width: 100%;
        aspect-ratio: 16 / 9;
    }
    
    .post img {
        width: 100%;
        max-height: 300px;
        object-fit: cover;
        height: auto;
    }
    
    .search {
        height: 140px;
    }
    
    .search #search-input {
        width: 90vw;
        padding: 15px;
    }
    
    .share-buttons {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tags {
        flex-wrap: wrap;
        justify-content: center;
    }
}