/*  ==========CARRUSEL==========  */

.image-carousel-left {
    position: relative;
    width: 100%;
    margin: 0 0 30px 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.image-carousel {
    position: relative;
    width: 100%;
    height: 450px;
    background: #fff;
    overflow: hidden;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    position: relative;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* AJUSTAR ESTILOS DE LOS BOTONES DEL CARROUSEL DE LAS FICHAS */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(19, 64, 77, 0.85);
    color: white;
    border: none;
    font-size: 2em;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* COLOR AL QUE CAMBIAN LOS BOTONES DEL CARROUSEL DE LAS FICHAS CUANDO SE PASA EL RATÓN POR ENCIMA*/
.carousel-btn:hover {
    background: rgba(19, 64, 77, 1);
}

.carousel-prev { left: 15px; }
.carousel-next { right: 15px; }

.carousel-dots {
    text-align: center;
    padding: 12px;
    background: rgba(0,0,0,0.03);
}

.dot {
    height: 10px;
    width: 10px;
    margin: 0 4px;
    background-color: rgba(19, 64, 77, 0.3);
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
}

.dot.active,
.dot:hover {
    background-color: rgba(19, 64, 77, 1);
}

.carousel-thumbnails {
    display: flex;
    gap: 5px;
    padding: 10px;
    background: #f5f5f5;
    /* Prevent horizontal page overflow by allowing thumbnails to wrap
       into multiple rows. Limit the visible height to avoid huge stacks;
       allow vertical scroll inside the thumbnail area if needed. */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden; /* don't let the thumbnail row force horizontal scroll */
    overflow-y: auto;   /* if there are many rows, allow internal vertical scroll */
    -webkit-overflow-scrolling: touch;
    flex-wrap: wrap;    /* allow wrapping to new lines */
    align-items: flex-start;
    max-height: 140px;  /* reasonable cap for 1-2 rows of thumbnails */
    padding-right: 6px; /* room for internal scrollbar */
}

.thumb-item {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    cursor: pointer;
    opacity: 0.6;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px; /* space when wrapping */
}

.thumb-item.active {
    opacity: 1;
    border-color: rgba(19, 64, 77, 1);
}

.thumb-item:hover {
    opacity: 0.8;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* ==========LAYOUT 2 COLUMNAS========== */

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.content-left {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.content-right {
    display: flex;
    flex-direction: column;
    gap: 25px;
}


/* ==========SECCIONES========== */


.info-section {
    background: white;
    padding: 0;
}

/* CAMBIAR ESTO PARA DAR EL ESTILO DESEADO AL TÍTULO "FUENTES DE INVESTIGACIÓN" */
.info-section h3 {
    font-size: 1.3em;
    color: #333;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.info-section p {
    line-height: 1.8;
    color: #555;
    margin: 0;
    text-align: justify;
}

/* CAMBIAR ESTO PARA DAR EL ESTILO DESEADO AL TEXTO DE LOS CAMPOS "FUENTES DE INVESTIGACIÓN" Y "REFERENCIAS" */
.content-html {
    font-size: 1.05em;
    line-height: 1.8;
    color: #555;
}

/* CAMBIAR ESTO PARA DAR EL ESTILO DESEADO AL TEXTO DE LOS CAMPOS "DESCRIPCIÓN" Y "MÁS INFORMACIÓN" */
.content-html p {
    margin: 0 0 15px 0;
    color: #555;
}

.content-html a {
    color: #13404d;
    text-decoration: none;
}

.content-html a:hover {
    text-decoration: underline;
}

.content-html ul,
.content-html ol {
    margin: 10px 0;
    padding-left: 25px;
}

.content-html li {
    margin-bottom: 8px;
}


/* ==========FICHAS RELACIONADAS========== */

.related-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.related-item-card {
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    border-radius: 3px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.related-item-card:hover {
    border-color: #13404d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.related-item-thumb {
    width: 100%;
    height: 150px;
    overflow: hidden;
    background: #e9ecef;
}

.related-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-item-title {
    padding: 12px;
    font-size: 0.95em;
    color: #333;
    font-weight: 500;
    line-height: 1.4;
}


/* ==========REFERENCIAS========== */

.references-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reference-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.reference-item:hover {
    background: #e9ecef;
}

.ref-bullet {
    font-size: 1.2em;
    flex-shrink: 0;
    margin-top: 2px;
}

.reference-item a {
    color: #13404d;
    text-decoration: none;
    font-weight: 500;
    line-height: 1.5;
}

.reference-item a:hover {
    text-decoration: underline;
}


/* ==========ALERTAS========== */

.alert-section {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-danger {
    background: #fff3cd;
    border: 2px solid #ffc107;
}

.alert-success {
    background: #d1ecf1;
    border: 2px solid #0dcaf0;
}

.alert-icon {
    font-size: 3em;
    line-height: 1;
    flex-shrink: 0;
}

.alert-text {
    flex: 1;
    display: flex;
    align-items: center;
}

.alert-text strong {
    display: block;
    font-size: 1.2em;
    margin-bottom: 4px;
    color: #333;
}

.alert-text p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

.references-section h3 {
    color: #333;
    border-bottom: 2px solid #13404d;
    padding-bottom: 8px;
}

.references-section a {
    color: #13404d;
    text-decoration: none;
}

.references-section a:hover {
    text-decoration: underline;
}


/* ==========MAPA========== */

.map-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.location-address {
    margin-bottom: 12px;
    color: #555;
    line-height: 1.6;
}

.view-map-link {
    color: #13404d;
    font-size: 0.9em;
    text-decoration: none;
}

.view-map-link:hover {
    text-decoration: underline;
}

.map-embed {
    border-radius: 8px;
    overflow: hidden;
}


/* ==========METADATOS========== */

/* EDITAR ESTA SECCIÓN PARA  CAMBIAR LOS ESTILOS DE LOS DATOS DE LA COLUMNA DERECHA DE LAS FICHAS */

.metadata-item {
    align-items: flex-start;
}

.metadata-item .bullet {
    display: none;
}

.metadata-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.metadata-item {
    display: flex;
    gap: 8px;
    line-height: 1.6;
    color: #555;
    font-size: 0.95em;
}

.metadata-item .bullet {
    color: #13404d;
    font-weight: bold;
}

metadata-item strong {
    color: #333;
}


/* ==========SECCIÓN AZUL: acceso a ficha completa========== */

.cta-section {
    margin: 40px auto 20px;
    padding: 28px 20px;
    border-radius: 12px;
    background: linear-gradient(135deg,#e6f3fb 0%, #cfe9f9 50%, #bde0f7 100%);
    border: 1px solid rgba(10,80,120,0.12);
    box-shadow: 0 6px 18px rgba(13,59,86,0.06);
    max-width: 1200px;
}
.cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.cta-text {
    font-size: 1.1em;
    color: #06354a;
    margin: 0;
    font-weight: 600;
}
.cta-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}
.btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
}
.cta-donate {
    background: #0b6d9a;
    color: #fff;
    border: 1px solid #084d6b;
}
.cta-donate:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(11,109,154,0.18); }
.cta-login {
    background: transparent;
    color: #06354a;
    border: 2px solid rgba(6,53,74,0.12);
}
.cta-login:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(6,53,74,0.06); }


/* ==========RESPONSIVE========== */

@media (max-width: 968px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .image-carousel {
        height: 350px;
    }
    
    .cta-inner {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .image-carousel-container {
        max-width: 100%;
    }
    
    .image-carousel {
        height: 300px;
    }
    
    .carousel-btn {
        width: 35px;
        height: 35px;
        font-size: 1.5em;
    }
}

/* Forzar que los botones CTA no cambien visual al ser visitados */
.cta-donate,
.cta-donate:link,
.cta-donate:visited,
.cta-donate:active,
.cta-donate:focus {
    background-color: #0b6d9a !important;
    color: #ffffff !important;
    border-color: #084d6b !important;
    text-decoration: none !important;
}

/* Mantener el estilo del botón de login también */
.cta-login,
.cta-login:link,
.cta-login:visited,
.cta-login:active,
.cta-login:focus {
    background-color: transparent !important;
    color: #06354a !important;
    border-color: rgba(6,53,74,0.12) !important;
    text-decoration: none !important;
}

/* Opcional: prevenir que el navegador cambie el color del texto en enlaces visitados */
a.cta-donate:-webkit-any-link:visited,
a.cta-login:-webkit-any-link:visited {
    color: inherit !important;
}


/* ==========LIGHTBOX========== */

.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: auto;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    margin: auto;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.3s;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
}

.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 3em;
    width: 60px;
    height: 60px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10001;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.lightbox-prev { left: 30px; }
.lightbox-next { right: 30px; }


/* ==========SECCIÓN DE COMENTARIOS========== */

.comments-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.comments-section h2,
.comments-section h3 {
    color: #13404d;
    margin-bottom: 20px;
    font-weight: 600;
}

#comments-container {
    margin-top: 20px;
}

/* Estilos para formulario de comentarios */
.comments-section form {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.comments-section textarea,
.comments-section input[type="text"],
.comments-section input[type="email"] {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1em;
}

.comments-section textarea {
    min-height: 120px;
    resize: vertical;
}

.comments-section button[type="submit"],
.comments-section input[type="submit"] {
    background: #13404d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.comments-section button[type="submit"]:hover,
.comments-section input[type="submit"]:hover {
    background: #0d2e38;
}

/* Estilos para comentarios individuales */
.comments-section .comment {
    padding: 20px;
    margin: 15px 0;
    background: white;
    border-left: 4px solid #13404d;
    border-radius: 6px;
}

.comments-section .comment-author {
    font-weight: 600;
    color: #13404d;
    margin-bottom: 8px;
}

.comments-section .comment-date {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 12px;
}

.comments-section .comment-body {
    line-height: 1.6;
    color: #333;
}

/* Responsive */
@media (max-width: 968px) {
    .comments-section {
        margin: 30px 20px;
        padding: 20px;
    }
}
