/* ==========================================
   DISEÑO DE PERFIL DE MIEMBRO
   ========================================== */

.profile-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5% 5%;
}

.profile-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 80px;
    align-items: start;
}

/* --- Identidad Visual --- */
.profile-image-container {
    position: relative;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

.member-portrait {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    filter: grayscale(20%);
    transition: filter 0.5s ease;
}

.member-portrait:hover {
    filter: grayscale(0%);
}

.member-rank-badge {
    position: absolute;
    bottom: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    background: #ffffff;
    border: 3px solid var(--accent-gold);
    /* */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.member-rank-badge img {
    width: 70%;
    height: auto;
    filter: brightness(0);
}

.member-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    border-left: 4px solid var(--accent-gold);
}

.meta-box {
    text-align: center;
}

.meta-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue-dark);
}

.meta-label {
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--blue-muted);
}

/* --- Contenido Editorial --- */
.member-eyebrow {
    font-size: 0.8rem;
    letter-spacing: 5px;
    color: var(--accent-gold);
    font-weight: 600;
}

.member-full-name {
    font-family: var(--font-heading);
    /* Playfair Display */
    font-size: 4.5rem;
    line-height: 1.1;
    margin: 15px 0;
    color: var(--blue-dark);
}

.member-divider {
    width: 80px;
    height: 4px;
    background-color: var(--accent-gold);
    margin-bottom: 40px;
}

.member-bio {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--blue-slate);
    margin-bottom: 50px;
    font-weight: 300;
}

.profile-details-grid {
    display: grid;
    gap: 40px;
}

.detail-group h4 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: var(--blue-dark);
}

.interest-tags span {
    display: inline-block;
    padding: 8px 18px;
    background: rgba(128, 150, 181, 0.1);
    color: var(--blue-navy);
    border-radius: 50px;
    font-size: 0.85rem;
    margin: 0 10px 10px 0;
}

.reading-list {
    list-style: none;
    padding: 0;
}

.reading-list li {
    margin-bottom: 15px;
    padding-left: 20px;
    position: relative;
    color: var(--blue-slate);
}

.reading-list li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--accent-gold);
}

/* Responsividad */
@media (max-width: 992px) {
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .profile-visual {
        max-width: 400px;
        margin: 0 auto;
    }

    .member-full-name {
        font-size: 3rem;
    }
}

.footer-simple {
    text-align: center;
    padding: 60px 0;
    color: var(--blue-muted);
    font-size: 0.8rem;
    letter-spacing: 1px;
}

/* --- Botones de Redes del Miembro --- */
.member-social-links {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.member-social-btn {
    padding: 7px 18px;
    border: 1px solid rgba(128, 150, 181, 0.3);
    border-radius: 3px;
    color: var(--blue-dark);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.member-social-btn:hover {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: white;
    transform: translateY(-2px);
}

/* --- Contenedor del Widget --- */
.lightwidget-widget {
    width: 100%;
    min-height: 800px;
    border: none;
}

/* Añadir a perfil.css */

.section-subtitle {
    font-family: var(--font-heading);
    color: var(--blue-dark);
    font-size: 1.8rem;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(214, 179, 89, 0.3);
    /* Línea dorada */
    padding-bottom: 10px;
}

/* --- Cuadrícula de Galería --- */
.member-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.gallery-item {
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
    /* Efecto zoom sutil */
}

/* --- Estilo para la lista de libros --- */
.favorite-books-list {
    list-style: circle inside;
    color: var(--blue-slate);
    line-height: 1.8;
}

/* --- Estilos para el Contenido Extendido y Galería de Ancho Completo --- */

.profile-extended-content {
    width: 100%;
    margin-top: 60px;
}

/* Subtítulo literario elegante para estas nuevas secciones */
.section-subtitle-literary {
    font-family: var(--font-heading);
    color: var(--blue-dark);
    font-size: 2.2rem;
    margin-bottom: 30px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(214, 179, 89, 0.4);
    text-transform: capitalize;
}

/* --- Cuadrícula de Galería de Ancho Completo --- */
.member-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.gallery-item {
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(128, 150, 181, 0.1);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

/* --- Estilo para la lista de libros --- */
.favorite-books-list {
    list-style: none;
    color: var(--blue-slate);
    line-height: 1.8;
    padding-left: 10px;
}

.favorite-books-list li::before {
    content: "📖 ";
    margin-right: 10px;
}

/* ==========================================
   ESTANTERÍA DE LIBROS (EFECTO 3D)
   ========================================== */

.books-gallery {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

/* El "teatro" donde ocurre el 3D */
.book-card {
    perspective: 1200px;
    text-align: center;
    cursor: pointer;
}

.book-cover-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    transform-style: preserve-3d;
    transform: rotateY(-22deg) rotateX(4deg);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: -10px 10px 20px rgba(0, 0, 0, 0.15);
    border-radius: 2px 6px 6px 2px;
    margin-bottom: 15px;
}

.book-card:hover .book-cover-wrapper {
    transform: rotateY(0deg) rotateX(0deg) scale(1.08);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

.book-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px 6px 6px 2px;
}

.book-spine-glare {
    position: absolute;
    left: 0;
    top: 0;
    width: 5%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));
    border-radius: 2px 0 0 2px;
    z-index: 2;
}

.book-title {
    font-family: var(--font-heading);
    color: var(--blue-dark);
    font-size: 0.95rem;
    line-height: 1.25;
    margin-bottom: 4px;
}

.book-author {
    font-size: 0.7rem;
    color: var(--blue-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* --- Responsividad para la estantería --- */
@media (max-width: 992px) {
    .books-gallery {
        grid-template-columns: repeat(3, 1fr);
    }

    .book-cover {
        aspect-ratio: 1 / 1;
    }
}

@media (max-width: 600px) {
    .books-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .book-cover {
        width: 100%;
    }
}

/* Corrección Definitiva: Tamaño de artículos en el portafolio */
#user-posts-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    gap: 25px;
}

/* ==========================================
   GALERÍA MASONRY (TIPO PINTEREST)
   ========================================== */
.masonry-grid {
    column-count: 3;
    column-gap: 20px;
    width: 100%;
    margin-bottom: 40px;
}

@media (max-width: 900px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 500px) {
    .masonry-grid {
        column-count: 1;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: zoom-in;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateZ(0);
    /* Fix para safari */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.masonry-item img {
    width: 100%;
    display: block;
    height: auto;
    transition: transform 0.5s ease;
}

.masonry-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.masonry-overlay .material-symbols-outlined {
    color: white;
    font-size: 3rem;
    transform: scale(0.5);
    transition: transform 0.3s ease;
}

.masonry-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.masonry-item:hover img {
    transform: scale(1.05);
}

.masonry-item:hover .masonry-overlay {
    opacity: 1;
}

.masonry-item:hover .masonry-overlay .material-symbols-outlined {
    transform: scale(1);
}

/* ==========================================
   MODAL LIGHTBOX INMERSIVO
   ========================================== */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 25, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.lightbox-close-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 10px;
    transition: transform 0.3s ease, color 0.3s ease;
}

.lightbox-close-btn .material-symbols-outlined {
    font-size: 2.5rem;
}

.lightbox-close-btn:hover {
    color: var(--accent-gold);
    transform: rotate(90deg);
}

.lightbox-content-wrapper {
    display: flex;
    background: #0f141c;
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
    max-width: 1200px;
    max-height: 85vh;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(214, 179, 89, 0.2);
}

.lightbox-image-container {
    flex: 2;
    background: #05080c;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}

.lightbox-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lightbox-info {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    padding: 40px;
    color: white;
    overflow-y: auto;
}

.lightbox-info h3 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    margin: 0 0 15px 0;
    line-height: 1.1;
}

.lightbox-badge {
    display: inline-block;
    padding: 5px 12px;
    background: rgba(214, 179, 89, 0.1);
    color: var(--accent-gold);
    border: 1px solid rgba(214, 179, 89, 0.3);
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 30px;
}

.lightbox-desc {
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.7);
    white-space: pre-wrap;
}

@media (max-width: 900px) {
    .lightbox-content-wrapper {
        flex-direction: column;
        max-height: 90vh;
        overflow-y: auto;
    }

    .lightbox-info {
        max-width: 100%;
    }

    .lightbox-close-btn {
        top: 15px;
        right: 15px;
    }
}