body {
    font-family: 'Inter', sans-serif;
    background-color: #f9fafb;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

.header-bar {
    width: 100%;
    background-color: rgb(0, 94, 23); /* indigo-600 */
    color: white;
    text-align: center;
    padding: 1rem 0;
    font-weight: 600;
    font-size: 1.125rem;
    z-index: 20;
}

@media (min-width: 640px) {
    .header-bar {
        font-size: 1.25rem;
    }
}

main {
    flex-grow: 1;
    max-width: 80rem; /* 1280px */
    margin: 2.5rem auto 0 auto;
    width: 100%;
    position: relative;
    z-index: 10;
}

article {
    position: relative;
    width: 100%;
}

.cover-photo {
    width: 100%;
    height: 12rem; /* 48 */
    object-fit: cover;
}

@media (min-width: 640px) {
    .cover-photo {
        height: 16rem; /* 64 */
    }
}

.profile-pic-wrapper {
    position: absolute;
    bottom: -4rem; /* -16 */
    left: 1.5rem; /* 6 */
    border: 4px solid white;
    border-radius: 9999px;
    overflow: hidden;
    background-color: #e5e7eb; /* gray-200 */
    width: 8rem; /* 32 */
    height: 8rem; /* 32 */
}

@media (min-width: 640px) {
    .profile-pic-wrapper {
        left: 3rem; /* 12 */
        width: 10rem; /* 40 */
        height: 10rem; /* 40 */
        bottom: -5rem; /* -20 */
    }
}

.profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.content {
    padding-top: 5rem; /* 20 */
    padding-bottom: 2rem; /* 8 */
    color: #111827; /* gray-900 */
    width: 100%;
}

@media (min-width: 640px) {
    .content {
        padding-top: 6rem; /* 24 */
    }
}

.content-inner {
    padding-left: 1.5rem; /* 6 */
    padding-right: 1.5rem; /* 6 */
}

@media (min-width: 640px) {
    .content-inner {
        padding-left: 3rem; /* 12 */
        padding-right: 3rem; /* 12 */
    }
}

h1 {
    font-weight: 800;
    font-size: 1.875rem; /* 3xl */
    margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
    h1 {
        font-size: 2.25rem; /* 4xl */
    }
}

.subtitle {
    color: rgb(0, 95, 24); /* indigo-600 */
    font-weight: 600;
    margin-bottom: 1rem;
}

.info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: #4b5563; /* gray-600 */
    margin-bottom: 1.5rem;
    align-items: center;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.info-item a {
    color: rgb(10, 0, 201);
    text-decoration: none;
}

.info-item a:hover {
    text-decoration: underline;
}

section {
    margin-bottom: 2rem;
    color: #374151; /* gray-700 */
}

section h2 {
    font-size: 1.5rem; /* 2xl */
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.prose p {
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 640px) {
    .gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .gallery {
        grid-template-columns: repeat(4, 1fr);
    }
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    aspect-ratio: 1 / 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    background-color: rgba(0, 0, 0, 0.3);
}

.gallery-overlay i {
    color: white;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay i {
    opacity: 1;
}

/* Modal */
#galleryModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#galleryModal div {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

#galleryModal button {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

#galleryModal img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.fa-times {
    transition: color 0.3s ease;
}

.fa-times:hover {
    color: red;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 30%; /* aspect ratio */
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Comentarios botón fijo */
#comments-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: #4f46e5;
    color: white;
    border: none;
    border-radius: 9999px;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.5);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 50;
    transition: background-color 0.3s ease;
}

#comments-button:hover {
    background-color: #4338ca;
}

/* Modal de comentarios */
#comments-modal {
    position: fixed;
    top: 0;
    right: -100%;
    width: 33.3333vw;
    max-width: 400px;
    height: 100vh;
    background-color: white;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

#comments-modal.open {
    right: 0;
}

#comments-modal header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#comments-modal header button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s ease;
}

#comments-modal header button:hover {
    color: #374151;
}

#comments-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
    color: #374151;
}

#comments-content p {
    margin-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #comments-modal {
        width: 80vw;
        max-width: none;
    }
}

/* Modal para nuevo comentario a la derecha */
#new-comment-modal {
    position: fixed;
    top: 0;
    right: -100%;
    width: 33.3333vw;
    max-width: 400px;
    height: 100vh;
    background: white;
    border-radius: 0 0 0 1rem;
    box-shadow: -4px 0 25px rgba(0, 0, 0, 0.2);
    z-index: 150;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

#new-comment-modal.open {
    right: 0;
}

#new-comment-modal header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#new-comment-modal header button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s ease;
}

#new-comment-modal header button:hover {
    color: #374151;
}

#new-comment-form {
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-grow: 1;
    overflow-y: auto;
    position: relative;
}

#new-comment-form input[type="text"],
#new-comment-form textarea {
    border: 1px solid #d1d5db;
    border-radius: 1.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    resize: vertical;
    transition: border-color 0.2s ease;
    background-color: white;
    z-index: 20;
    position: relative;
}

#new-comment-form input[type="text"]:focus,
#new-comment-form textarea:focus {
    outline: none;
    border-color: #4f46e5;
    background-color: #eef2ff;
}

#new-comment-form textarea {
    min-height: 4rem;
    max-height: 8rem;
}

#new-comment-form button {
    background-color: #4f46e5;
    color: white;
    border: none;
    border-radius: 9999px;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.3s ease;
    margin-top: auto;
    z-index: 20;
    position: relative;
}

#new-comment-form button:hover {
    background-color: #4338ca;
}

#new-comment-form button:disabled {
    background-color: #a5b4fc;
    cursor: not-allowed;
    box-shadow: none;
}

/* Overlay */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.06);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive */
@media (max-width: 480px) {
    #new-comment-modal,
    #comments-modal {
        width: 80vw !important;
        max-width: none !important;
        right: -100% !important;
        border-radius: 1rem !important;
    }

    #new-comment-modal.open,
    #comments-modal.open {
        right: auto !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        height: auto !important;
        max-height: 90vh !important;
    }
}

/* Estilos para el carrusel de videos */
.video-carousel {
    position: relative;
    margin-bottom: 2rem;
}

.video-container {
    position: relative;
    width: 100%;
    height: 530px; /* Cambiado: altura fija */
    overflow: hidden;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: #000;
}

.video-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.5s ease;
}

.video-item.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.video-item.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

.video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    font-size: 1.2rem;
    color: #333;
    transition: all 0.3s ease;
}

.carousel-arrow.left {
    left: 10px;
}

.carousel-arrow.right {
    right: 10px;
}

.carousel-arrow:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.video-indicators-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    gap: 8px;
}

.video-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #cbd5e1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-indicator:hover {
    background-color: #94a3b8;
}

.video-indicator.active {
    background-color: rgb(0, 94, 23);
    transform: scale(1.2);
}

/* Asegurar accesibilidad para los controles */
.carousel-arrow:focus,
.video-indicator:focus {
    outline: 2px solid rgb(0, 94, 23);
    outline-offset: 2px;
}

/* Responsive para el carrusel */
@media (max-width: 640px) {
    .carousel-arrow {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
}