/* Custom fonts for the blog */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,100..900;1,100..900&display=swap');

/* Evita scroll lateral global en todas las vistas del blog */
html {
    overflow-x: hidden !important;
    max-width: 100% !important;
}
body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
}

/* Navbar siempre a ancho completo */
.navbar-wrapper,
.navbarCustom {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* En móvil, reducir padding del .container de Bootstrap */
@media (max-width: 768px) {
    .container,
    .container-fondo {
        padding-left: 8px !important;
        padding-right: 8px !important;
        max-width: 100% !important;
    }

    .newsContainer {
        padding: 10px 12px !important;
    }
}



/* Contenedor de noticias */
.newsContainer {
    padding: 10px 150px;
    min-height: 100vh;
    background-color: rgb(250, 250, 250) !important;
    
}

.newsContainer h1, h2, h3, h4, h5, p, time{
    font-family: 'Raleway',  sans-serif !important;
}

.newsContainer h1{
    font-weight: 800;
}
.newsContainer h2{
    font-weight: 600;
    padding: 0 0 30px 0;
}

@media (max-width: 900px) {
    .newsContainer {
        padding: 10px 20px;
    }
}

/* Cards de noticias */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    grid-auto-rows: 10px;
    gap: 30px;
}


/* new Cards de noticias */

.masonry-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    padding-bottom: 50px;
}

.masonry-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.news-card-new.hidden-news {
    display: none;
}

.news-card-new {
    position: relative;
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    overflow: hidden;
    background-color: white;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.news-card-new.card-visible {
    opacity: 1;
    transform: translateY(0);
}


.ultimas-noticias-titulo {
    text-align: center;
}

.card-image-container-new{
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}



.card-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0); /* transparente por defecto */
    transition: background-color 0.5s ease;
}

/*.news-card-new:hover .card-image-container-new img {
    transform: scale(1.1); 
}*/

.news-card-new:hover .card-image-overlay {
    background-color: rgba(255, 255, 255, 0.3); /* overlay blanco transparente */
}

.card-image-new{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


.card-title-container-new {
    display: flex;
    flex-direction: column;
    align-items: flex-start;   /* alineación a la izquierda */
    text-align: left;
    color: #0f0d0e;
    background-color: white;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    padding: 15px 20px;
    box-sizing: border-box;
}

.card-title-arrow {
    position: absolute;
    bottom: 5px; /* distancia desde el borde inferior */
    right: 15px;  /* distancia desde el borde derecho */
    font-size: 3rem;
    color: #777;
    transition: color 0.3s, transform 0.3s;
}

.news-card-new:hover .card-title-arrow {
    color: #00cca9;
    transform: translateX(5px);
}

.card-title-new {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    color: #1d1d1d;
}

.card-excerpt-new {
    margin: 0 0 8px 0;
    font-size: 1.3rem;
    color: #555;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-date-new {
    margin: 0;
    font-size: 1.6rem;
    color: #777;
}

.reading-time-new {
    text-align: left;
    font-size: 1.15rem;
    color: #777;
}



.news-card {
    display: flex;
    flex-direction: column;
    border-radius: 15px;
    box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    overflow: hidden;
    background-color: white;
}

/* Banner superior */
.card-header {
    
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f0d0e;
    background-color: white;
    padding: 10px 20px;
    position: relative;
}

.card-title {
    margin: 0;
    font-size: 2.75rem;
    font-weight: bold;
    font-weight: bold;
    color: #1d1d1d;
}
.reading-time {
    position: absolute;
    right: 10px;        /* distancia desde el borde derecho */
    font-size: 1.15rem;
    color: #666;
    bottom:-10px;
}

/* Imagen */
.card-img-top {
    width: 100%;
    height: auto;        /* se adapta al ancho */
    max-height: 250px;   /* límite opcional */
    object-fit: cover;
    display: block;
}

/* Comentario flotante */
.card-image-container {
    position: relative;
    width: 100%;
}

/* Badge centrado entre imagen y card-body */
.comment-badge {
    position: absolute;
    top: 95%; /* parte inferior de la imagen */
    left: 90%; /* centrado horizontal */
    transform: translate(-50%, -50%); /* flota mitad sobre la imagen, mitad sobre el card-body */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ccc;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 16px;
    z-index: 2;
    transition: background-color 0.3s;
}

.comment-badge.has-comments {
    background-color: #00cca9;
}

.comment-badge:hover {
    background-color: #007766;
    color:white;
}

.comment-badge .badge-count {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #a5a4a4;
    color: white;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pie de la card */

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;   /* apilar texto y botones verticalmente */
    justify-content: center;  /* centra el texto en eje vertical */
    align-items: center;      /* centra en eje horizontal */
    text-align: center;
    color: #0f0d0e;
    background-color: white;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    padding: 15px 20px;
    box-sizing: border-box;
    height: auto; /* ← se ajusta al contenido */
    min-height: 100px; /* opcional: altura mínima para que no queden cards muy pequeñas */
    margin:auto;
}

.card-text {
    margin: auto;
    padding: 10px;
    font-size: 1.5rem;
    line-height: 1.4;
    text-align: center;
    overflow: visible; /* ← aseguramos que no corte nada */
}

.row [class*="col-"] {
    margin-bottom: 30px; /* separación vertical */
    padding-left: 20px;  /* separación horizontal izquierda */
    padding-right: 20px; /* separación horizontal derecha */
}

/* Footer */
.footer {
    position: relative;
    bottom: 0;
    width: 100%;
    height: 50px;
    background-color: #0f0d0e;
    color: white;
    text-align: center;
    line-height: 50px;

}



/* Buscador de noticias */
.titulo-blog-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
}

.titulo-blog {
    text-align: center;
    margin: 0;
}

.buscador-area {
    position: absolute;
    right: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.buscador-toggle {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.buscador-toggle:hover {
    color: #e8734a;
    background: rgba(232, 115, 74, 0.08);
}

/* Input wrapper: oculto por defecto, se expande al añadir .buscador-open */
.buscador-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 0;
    overflow: hidden;
    opacity: 0;
    transition: width 0.25s ease, opacity 0.2s ease;
}

.buscador-input-wrapper.buscador-open {
    width: 240px;
    opacity: 1;
    overflow: visible;
}

.buscador-input {
    width: 100%;
    padding: 8px 14px;
    border: 2px solid #ddd;
    border-radius: 24px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, padding-left 0.15s;
}

.buscador-input.buscador-loading {
    padding-left: 34px;
}

.buscador-input:focus {
    border-color: #e8734a;
}

.buscador-spinner {
    position: absolute;
    left: 10px;
    width: 14px;
    height: 14px;
    border: 2px solid #ddd;
    border-top-color: #e8734a;
    border-radius: 50%;
    animation: buscador-spin 0.7s linear infinite;
    pointer-events: none;
}

@keyframes buscador-spin {
    to { transform: rotate(360deg); }
}
