/* Estilos generales */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

.headerpost {
    background-image: url("https://platform.jzds.me/rpty/img/bannerPanama.png");
    background-color: var(--seasalt);
    color: var(--seasalt);
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 6px var(--shadow-color);
    background-size: cover; /* Asegura que la imagen cubra todo el header */
    background-position: center; /* Centra la imagen en el header */
    background-repeat: no-repeat; /* Evita que la imagen se repita */
}

.headerpost h1 {
    margin: 1rem;
    font-size: 2.5rem;
    padding: 0.5rem;
}

main {
    padding: 0.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Grid para los posts */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0; /* Añadir padding para evitar desbordamientos */
}

/* Estilos para cada post */
.post {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.post:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.post img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
    transition: transform 0.3s ease;
}

.post:hover img {
    transform: scale(1.05);
}

.post-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post h2 {
    font-size: 1.4rem;
    margin: 0 0 1rem 0;
    color: #333144;
    font-weight: 700;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.post:hover h2 {
    color: #ffc107;
}

.post p {
    margin: 0 0 1.5rem 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.post-date {
    font-size: 0.85rem;
    color: #888;
}

.post a {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background-color: #333144;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 2px solid #333144;
}

.post a:hover {
    background-color: transparent;
    color: #333144;
    transform: translateY(-2px);
}

.post-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: #ffc107;
    color: #333;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1;
}

/* Estilos para los botones de compartir */
.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.share-button:hover {
    transform: scale(1.1);
}

/* Colores específicos para cada red social */
.share-button.facebook {
    background-color: #3b5998; /* Color de Facebook */
}

.share-button.twitter {
    background-color: #1da1f2; /* Color de Twitter */
}

.share-button.whatsapp {
    background-color: #25d366; /* Color de WhatsApp */
}

/* Efecto hover para cada botón */
.share-button.facebook:hover {
    background-color: #344e86;
}

.share-button.twitter:hover {
    background-color: #1991db;
}

.share-button.whatsapp:hover {
    background-color: #128c7e;
}

/* Estilos para el banner de blog */
.banner.blog {
    margin: 20px 0;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.banner.blog img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.slick-slider {
    position: relative;
    display: block;
    box-sizing: border-box;
    user-select: none;
    touch-action: pan-y;
    margin: 0;
}

.slick-slide {
    display: inline-block;
    vertical-align: top;
    margin: 0;
}

/* Estilos para posts individuales (post.php) */
main article.post {
    max-width: 800px;
    margin: 2rem auto;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

main article.post img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
}

main article.post .post-header {
    padding: 2rem;
    border-bottom: 1px solid #f0f0f0;
}

main article.post .post-header h1 {
    font-size: 2.2rem;
    color: #333144;
    margin: 0 0 1rem 0;
    line-height: 1.3;
    font-weight: 700;
}

main article.post .post-meta-single {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

main article.post .post-meta-single .post-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

main article.post .post-meta-single .post-category-single {
    background-color: #ffc107;
    color: #333;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

main article.post .post-content-single {
    padding: 2rem;
    line-height: 1.8;
    color: #444;
}

main article.post .post-content-single h2 {
    font-size: 1.6rem;
    color: #333144;
    margin: 2rem 0 1rem 0;
    border-bottom: 2px solid #ffc107;
    padding-bottom: 0.5rem;
}

main article.post .post-content-single h3 {
    font-size: 1.4rem;
    color: #333144;
    margin: 1.5rem 0 0.8rem 0;
}

main article.post .post-content-single p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

main article.post .post-content-single ul,
main article.post .post-content-single ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

main article.post .post-content-single li {
    margin-bottom: 0.5rem;
}

main article.post .post-content-single blockquote {
    border-left: 4px solid #ffc107;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #666;
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
}

main article.post .post-content-single code {
    background-color: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

main article.post .post-content-single pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

main article.post .post-content-single pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

main article.post .post-content-single a {

    text-decoration: none;
    border-bottom: 2px solid #ffc107;
    transition: all 0.3s ease;
}

main article.post .post-content-single a:hover {
    color: #ffc107;
    border-bottom-color: #333144;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.2rem;
    }
    
    .post-content {
        padding: 1.2rem;
    }
    
    .post h2 {
        font-size: 1.3rem;
    }
    
    main article.post {
        margin: 1.5rem;
    }
    
    main article.post .post-header h1 {
        font-size: 1.8rem;
    }
    
    main article.post img {
        height: 300px;
    }
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .headerpost h1 {
        font-size: 2rem;
        margin: 0.5rem;
    }
    
    .posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
        padding: 0.5rem;
    }
    
    .post {
        border-radius: 10px;
    }
    
    .post img {
        height: 180px;
        border-radius: 10px 10px 0 0;
    }
    
    .post-content {
        padding: 1rem;
    }
    
    .post h2 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }
    
    .post p {
        font-size: 0.85rem;
        margin-bottom: 1rem;
        -webkit-line-clamp: 2;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
        padding-top: 0.8rem;
    }
    
    .post-date {
        font-size: 0.8rem;
    }
    
    .post a {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        width: 100%;
        text-align: center;
    }
    
    .post-category {
        top: 10px;
        left: 10px;
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
}

@media (max-width: 480px) {
    /* Mejoras específicas para blog.php en móviles */
    .headerpost {
        padding: 0.8rem;
    }
    
    .headerpost h1 {
        font-size: 1.6rem;
        margin: 0.5rem;
        padding: 0.3rem;
        text-align: center;
    }
    
    main {
        padding: 0.5rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.5rem 0;
    }
    
    .post {
        border-radius: 12px;
        margin: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .post img {
        height: 180px;
        border-radius: 12px 12px 0 0;
    }
    
    .post-content {
        padding: 1rem;
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .post h2 {
        font-size: 1.2rem;
        margin: 0;
        line-height: 1.3;
        text-align: left;
        color: #333144;
    }
    
    .post p {
        font-size: 0.9rem;
        margin: 0;
        -webkit-line-clamp: 3;
        line-height: 1.5;
        color: #666;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
        padding-top: 0.8rem;
        margin-top: auto;
        border-top: 1px solid #f0f0f0;
    }
    
    .post-date {
        font-size: 0.8rem;
        color: #888;
        text-align: center;
    }
    
    .post a {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        width: auto;
        text-align: center;
        border-radius: 6px;
        background-color: #333144;
        color: white;
        text-decoration: none;
        transition: all 0.3s ease;
    }
    
    .post a:hover {
        background-color: #ffc107;
        color: #333;
        transform: translateY(-2px);
    }
    
    .post-category {
        top: 10px;
        left: 10px;
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
        border-radius: 15px;
    }
    
    .share-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.8rem;
        margin: 1.5rem 0;
        padding: 0 1rem;
    }
    
    .share-button {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    /* Mejoras específicas para post.php en móviles */
    main article.post {
        margin: 0.5rem;
        border-radius: 12px;
    }
    
    main article.post img {
        height: 200px;
        border-radius: 12px 12px 0 0;
    }
    
    main article.post .post-header {
        padding: 1rem;
    }
    
    main article.post .post-header h1 {
        font-size: 1.4rem;
        line-height: 1.3;
        margin-bottom: 0.8rem;
        text-align: center;
    }
    
    main article.post .post-meta-single {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.8rem;
        text-align: center;
    }
    
    main article.post .post-content-single {
        padding: 1rem;
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    main article.post .post-content-single h2 {
        font-size: 1.2rem;
        margin: 1.2rem 0 0.8rem 0;
        padding-bottom: 0.3rem;
        text-align: left;
    }
    
    main article.post .post-content-single h3 {
        font-size: 1.1rem;
        margin: 1rem 0 0.6rem 0;
        text-align: left;
    }
    
    main article.post .post-content-single p {
        font-size: 0.95rem;
        margin-bottom: 1rem;
        text-align: justify;
    }
    
    main article.post .post-content-single ul,
    main article.post .post-content-single ol {
        padding-left: 1.2rem;
        margin: 0.8rem 0;
    }
    
    main article.post .post-content-single li {
        margin-bottom: 0.4rem;
    }
    
    main article.post .post-content-single blockquote {
        padding: 0.8rem;
        margin: 1rem 0;
        font-size: 0.9rem;
    }
    
    main article.post .post-content-single pre {
        padding: 0.8rem;
        margin: 1rem 0;
        font-size: 0.8rem;
    }
    
    main article.post .post-content-single code {
        font-size: 0.75rem;
        padding: 0.1rem 0.25rem;
    }
}
