/* --- ARTICULO PAGE SPECIFIC STYLES --- */

/* --- ARTICLE NAVIGATION --- */
.article-navigation {
    max-width: 900px;
    margin: 40px auto;
    text-align: center;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--color-primario);
    color: white;
    padding: 12px 25px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: var(--sombra-caja);
}

.nav-btn:hover {
    background-color: var(--color-secundario);
    transform: translateX(-5px);
    color: white;
}

.nav-btn i {
    transition: transform 0.3s ease;
}

.nav-btn:hover i {
    transform: translateX(-3px);
}

/* Encabezado del artículo */
.article-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 40px 0;
    background: linear-gradient(to right, #f4f7f6, #fff);
}

.article-category {
    display: inline-block;
    background-color: var(--color-secundario);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.article-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.article-meta {
    color: #777;
    font-size: 0.95rem;
}

/* --- VIEW INDICATOR --- */
.view-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    color: #666;
    font-size: 0.95rem;
}

.view-indicator i {
    color: var(--color-primario);
}

.view-count {
    letter-spacing: 0.5px;
}

.view-meter {
    width: 160px;
    height: 3px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
}

.view-meter-fill {
    width: var(--fill, 50%);
    height: 100%;
    background: var(--color-primario);
    transition: width 0.8s ease;
}

.article-body {
    background-color: white;
    padding: 40px;
    border-radius: var(--borde-redondeado);
    box-shadow: var(--sombra-caja);
    font-size: 1.1rem;
    text-align: justify;
    /* max-width: 900px; */
    margin: 0 auto;
}

.article-body p {
    margin-bottom: 20px;
}

#more-text {
    display: none;
}

.read-more-btn {
    color: var(--color-secundario);
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    font-size: 1.1rem;
}

.read-more-btn:hover {
    text-decoration: underline;
}

/* --- REFERENCIAS --- */
.article-references {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.article-references h4 {
    margin-bottom: 15px;
    color: var(--color-primario);
}

.reference-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ref-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-secundario);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.ref-link:hover {
    color: var(--color-primario);
    text-decoration: underline;
}

.ref-link i {
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* --- IMPROVED IMAGE MOSAIC STYLES --- */
.image-gallery-mosaic {
    margin: 40px auto;
    max-width: 900px;
}

.image-gallery-mosaic h3 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--color-primario);
}

.mosaic-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    justify-content: center;
}

.mosaic-item {
    position: relative;
    width: 200px;
    height: 200px;
    overflow: hidden;
    border-radius: var(--borde-redondeado);
    cursor: pointer;
    box-shadow: var(--sombra-caja);
    transition: transform 0.3s ease;
    margin: 0 auto;
}

.mosaic-item:hover {
    transform: scale(1.05);
}

.mosaic-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    font-size: 0.85rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mosaic-item:hover .image-caption {
    opacity: 1;
}

/* --- VIDEO SECTION --- */
.article-video {
    max-width: 900px;
    margin: 60px auto;
    padding: 0 20px;
}

.video-title {
    text-align: center;
    color: var(--color-primario);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    font-weight: 400;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    justify-items: center;
}

.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 720px;
    padding-top: 56.25%;
    background: #000;
}

.video-wrapper iframe,
.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* --- COMMENTS SECTION STYLES --- */
.comments-section {
    max-width: 900px;
    margin: 60px auto 0;
    background-color: white;
    padding: 40px;
    border-radius: var(--borde-redondeado);
    box-shadow: var(--sombra-caja);
}

.comments-section h3 {
    color: var(--color-primario);
    margin-bottom: 30px;
    font-size: 1.8rem;
    text-align: center;
}

.comment-form {
    margin-bottom: 40px;
    padding: 30px;
    background-color: #f8f9fa;
    border-radius: var(--borde-redondeado);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--color-primario);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: var(--fuente-cuerpo);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-secundario);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    background-color: var(--color-secundario);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: #2980b9;
}

.comments-list {
    margin-top: 40px;
}

.comment {
    padding: 25px;
    border-left: 4px solid var(--color-secundario);
    background-color: #f8f9fa;
    margin-bottom: 20px;
    border-radius: 0 var(--borde-redondeado) var(--borde-redondeado) 0;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.comment-author {
    font-weight: bold;
    color: var(--color-primario);
    font-size: 1.1rem;
}

.comment-date {
    color: #777;
    font-size: 0.9rem;
}

.comment-text {
    line-height: 1.6;
    color: var(--color-texto);
}

/* --- MODAL STYLES --- */
.carousel-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.4s;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 0;
    width: 90%;
    max-width: 900px;
    height: 80%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.modal-slide {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.modal-slide img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.modal-caption {
    color: white;
    text-align: center;
    padding: 15px;
    width: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-caption h3 {
    color: white;
    margin-bottom: 5px;
}

.close-btn {
    position: absolute;
    top: 25px;
    right: 45px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: #bbb;
    text-decoration: none;
}

.modal-nav-btn {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0,0,0,0.5);
}

.modal-nav-btn:hover {
    background-color: rgba(0,0,0,0.8);
}

.prev {
    left: 25px;
    border-radius: 3px 0 0 3px;
}

.next {
    right: 25px;
    border-radius: 0 3px 3px 0;
}

/* --- RESPONSIVE STYLES --- */
@media (max-width: 768px) {
    .comments-section {
        margin: 40px 20px 0;
        padding: 20px;
    }
    
    .comment-form {
        padding: 20px;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* --- BOTONERA DE COMPARTIR (RRSS) --- */
.share-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .6rem 1rem;
    padding: .9rem 1.2rem;
    background: #f8f8f8;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    margin: 1.4rem 0;
    font-size: .85rem;
}

.share-bar--bottom {
    border-top: 3px solid #c9a84c; /* ajusta al color de acento del sitio */
}

.share-bar__label {
    font-weight: 600;
    color: #444;
    white-space: nowrap;
}

.share-bar__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .9rem;
    border-radius: 6px;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: filter .15s, transform .1s;
    white-space: nowrap;
    color: #fff;
}

.share-btn:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
    color: #fff;
}

.share-btn:active {
    transform: translateY(0);
}

.share-btn--facebook { background: #1877f2; }
.share-btn--twitter  { background: #000; }
.share-btn--whatsapp { background: #25d366; }
.share-btn--linkedin { background: #0a66c2; }
.share-btn--telegram { background: #2ca5e0; }
.share-btn--copy     { background: #555; }
.share-btn--copy.copied { background: #2e7d32; }

@media (max-width: 480px) {
    .share-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .share-btn span {
        display: none;
    }
    .share-btn {
        padding: .55rem .75rem;
        font-size: .9rem;
    }
}

/* Responsive image gallery - maintain square sizes */
.mosaic-container {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.mosaic-item {
    width: 150px;
    height: 150px;
}

@media (max-width: 480px) {
    .mosaic-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .mosaic-item {
        width: 120px;
        height: 120px;
    }
}