/* ==========================================
   MODAL CONTENEDOR
   ========================================== */
.tech-news-modal .custom-news-width {
    max-width: 960px;
}

.tech-news-modal .modal-content {
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
}

.tech-news-modal .modal-dialog {
    max-height: 90vh;
}

.tech-news-modal .modal-body {
    overflow-y: auto;
    max-height: none;
}

/* ==========================================
   BOTÓN VOLVER FLOTANTE
   ========================================== */
.btn-back-floating {
    position: absolute;
    top: 30px;
    left: 20px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-back-floating:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* ==========================================
   HEADER DEL MODAL (imagen + título encima)
   ========================================== */
.news-header-wrapper {
    position: relative;
    width: 100%;
    height: 480px;
    background: #111;
}

.news-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-header-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 24px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.news-category-badge {
    background: #0d6efd;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border-radius: 4px;
    text-transform: uppercase;
}

.news-title-display {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* ==========================================
   CUERPO DEL MODAL
   ========================================== */
.news-body-content {
    padding: 24px;
    background: #ffffff;
}

.news-meta-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: scale-down;
    border: 2px solid #f0f0f0;
}

.author-details {
    display: flex;
    flex-direction: column;
}

.author-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    text-transform: capitalize;
}

.news-date-location {
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px;
}

.news-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.action-btn:hover {
    transform: translateY(-2px);
    background: #e9ecef;
}

.tech-divider {
    border: 0;
    height: 1px;
    background: #eaeaea;
    margin: 20px 0;
}

.news-text-content {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #333;
    padding: 0 2rem 2rem;
}

.news-text-content p {
    margin-bottom: 1.5rem;
}

.news-text-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Imágenes secundarias 1 y 2 */
.news-extra-images {
    margin-top: 1.5rem;
}

.news-extra-images img {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 10px;
}

/* ==========================================
   ADAPTATIVO POR ALTURA DE PANTALLA
   El contenedor se hace más chico cuando la
   pantalla es baja (1280x800, 1366x768, etc.)
   ========================================== */

/* Pantallas entre 851px y 1000px de alto */
@media (max-height: 1000px) and (min-height: 851px) {
    .tech-news-modal .custom-news-width {
        max-width: 880px;
    }
    .news-header-wrapper {
        height: 420px;
    }
}

/* Pantallas entre 701px y 850px de alto (incluye 1280x800) */
@media (max-height: 850px) {
    .tech-news-modal .custom-news-width {
        max-width: 780px;
    }
    .news-header-wrapper {
        height: 320px;
    }
    .tech-news-modal .modal-body {
        max-height: calc(92vh - 320px);
    }
    .news-title-display {
        font-size: 1.3rem;
    }
    .news-text-content {
        font-size: 1rem;
        padding: 0 1.5rem 1.5rem;
    }
}

/* Pantallas muy bajas (menos de 700px de alto) */
@media (max-height: 700px) {
    .tech-news-modal .custom-news-width {
        max-width: 700px;
    }
    .news-header-wrapper {
        height: 260px;
    }
    .tech-news-modal .modal-body {
        max-height: calc(92vh - 260px);
    }
    .news-title-display {
        font-size: 1.2rem;
    }
    .news-text-content {
        font-size: 0.95rem;
        padding: 0 1.25rem 1.25rem;
    }
    .news-body-content {
        padding: 18px;
    }
}

/* Pantallas extremadamente bajas (menos de 600px) */
@media (max-height: 600px) {
    .tech-news-modal .custom-news-width {
        max-width: 620px;
    }
    .news-header-wrapper {
        height: 220px;
    }
    .tech-news-modal .modal-body {
        max-height: calc(92vh - 220px);
    }
    .news-title-display {
        font-size: 1.1rem;
    }
}

/* ==========================================
   AJUSTES POR ANCHO (tablet / móvil)
   Solo afectan el margen y paddings internos
   ========================================== */

/* Tablet (577px - 1024px ancho) */
@media (min-width: 577px) and (max-width: 1024px) {
    .tech-news-modal .custom-news-width {
        max-width: 92%;
        width: 92%;
    }
    .tech-news-modal .modal-dialog {
        margin: 4vh auto;
    }
}

/* Móvil (max 576px ancho) */
@media (max-width: 576px) {
    .tech-news-modal .custom-news-width {
        max-width: 92%;
        width: 92%;
    }
    .tech-news-modal .modal-dialog {
        margin: 3vh auto;
        height: auto;
    }
    .tech-news-modal .modal-content {
        border-radius: 16px;
        height: auto;
        min-height: auto;
    }
    .news-header-wrapper {
        height: 220px;
    }
    .tech-news-modal .modal-body {
        max-height: calc(88vh - 220px);
        overflow-y: auto;
    }
    .news-title-display {
        font-size: 1.2rem;
    }
    .news-text-content {
        font-size: 1rem;
        padding: 0 1rem 1rem;
    }
    .news-body-content {
        padding: 16px;
    }
    .author-avatar {
        width: 38px;
        height: 38px;
    }
    .author-name {
        font-size: 0.95rem;
    }
}

/* Móvil muy pequeño (max 380px ancho) */
@media (max-width: 380px) {
    .tech-news-modal .custom-news-width {
        max-width: 95%;
        width: 95%;
    }
    .tech-news-modal .modal-dialog {
        margin: 2vh auto;
    }
    .news-header-wrapper {
        height: 190px;
    }
    .news-title-display {
        font-size: 1.05rem;
    }
    .author-avatar {
        width: 34px;
        height: 34px;
    }
    .author-name {
        font-size: 0.85rem;
    }
    .news-date-location {
        font-size: 0.7rem;
    }
}