/* =========================================
   VARIABLES GLOBALES
   ========================================= */
:root {
    --color-fondo: #fcfcfc;
    --color-texto: #1a1a1a;
    --espaciado-base: 1.5rem;
}

/* =========================================
   ESTILOS COMPARTIDOS (Títulos)
   ========================================= */
.titulo-principal {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    color: #1a1a1a;
    margin: 0;
    text-align: center;
}

.subtitulo {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.6em;
    color: #1b1a1a; /* Gris oscuro con mayor contraste */
    margin-top: 5px;
    text-align: center;
}

/* =========================================
   1. PÁGINA DE INICIO (index.html)
   ========================================= */
.index-page {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #cac4c4; /* Fondo blanco visible en el margen */
    color: #d82121;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow: hidden;
}
.index-page header {
    position: absolute;
    top: 5px; /* Separación del borde superior */
    left: 5dvh; /* Separación del borde izquierdo */
    width: calc(100% - 20px); /* Ajuste para el margen derecho */
    box-sizing: border-box;
    z-index: 10;
    padding: var(--espaciado-base) 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.index-page nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
    padding: 0;
}
.index-page nav a {
    text-decoration: none;
    color: #1a1a1a;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: color 0.3s ease, border-bottom 0.3s ease;
}
.index-page nav a:hover {
    color: #f7bc81;
}
.index-page nav a.active {
    color: #5f442a;
    border-bottom: 2px solid #a67c52;
    padding-bottom: 3px;
}
.index-page main {
    padding: 0;
}
.index-page .titulo-principal {
    font-size: 1.8rem;
    line-height: 1.1;
    text-shadow: none;
}
.index-page .subtitulo {
    font-size: 0.8rem;
    text-shadow: none;
}
.index-page footer {
    position: absolute;
    bottom: 10px; /* Alineación al borde inferior del carrusel */
    left: 10px;
    width: calc(100% - 20px);
    box-sizing: border-box;
    text-align: center;
    padding: var(--espaciado-base);
    font-size: 0.8rem;
    color: #fff;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.8);
}

/* Carrusel Pantalla Completa (Index) */
.carousel {
    position: fixed;
    top: 10px;
    left: 10px;
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    overflow: hidden;
    z-index: -1;
    border: 1px solid #000; /* Contorno negro fino */
    box-shadow: 0 4px 20px rgba(0,0,0,0.15); /* Sombreado gris sutil */
    box-sizing: border-box;
}
.carousel-images {
    position: relative;
    width: 100%;
    height: 100%;
}
.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}
.carousel-item.active {
    opacity: 1;
}
.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.carousel-btn {
    position: fixed;
    z-index: 10;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    font-size: 1.8rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    user-select: none;
}
.carousel-btn:hover { background-color: rgba(0, 0, 0, 0.8); }
.prev { left: 30px; border-radius: 0; opacity: 1; }
.next { right: 30px; border-radius: 0; opacity: 0; }

/* =========================================
   2. PÁGINAS DE TEXTO (sobre_mi, sobre_mi_obra)
   ========================================= */
.text-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fafafa; /* Fondo más limpio y neutro */
    font-family: 'Segoe UI', Arial, sans-serif;
    padding-bottom: 50px;
}
.text-page .container {
    text-align: left;
    background: #ffffff;
    padding: 60px 40px; /* Más espacio en blanco (respiración) */
    border-radius: 0; /* Bordes totalmente rectos */
    box-shadow: none; /* Sin sombras */
    border: 1px solid #eaeaea; /* Borde muy sutil para delimitar */
    max-width: 900px; /* Recuadro más ancho */
    width: 90%;
    margin-top: 40px;
}
.text-page .titulo-principal {
    font-size: 2.8rem;
}
.text-page .subtitulo {
    font-size: 1.2rem;
    margin-bottom: 32px;
}
.text-page .btn {
    display: inline-block;
    padding: 14px 38px;
    font-size: 1.2rem;
    color: #fff;
    background: #a67c52;
    border: none;
    border-radius: 0; /* Botones con bordes rectos */
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}
.text-page .btn:hover {
    background: #8c6239;
}
.texto-formateado {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    text-align: justify;
}
.texto-formateado p {
    margin-bottom: 1.5rem;
}
/* Enlaces visitados en las páginas de texto claro */
.text-page a:visited {
    color: #333333;
}
.text-page nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    padding: 20px 0;
    margin: 0;
    justify-content: center;
}
.text-page nav a {
    text-decoration: none;
    color: #1a1a1a;
    font-weight: bold;
    text-transform: uppercase;
    transition: color 0.3s ease, border-bottom 0.3s ease;
}
.text-page nav a:hover {
    color: #a67c52;
}
.text-page nav a.active {
    color: #a67c52;
    border-bottom: 2px solid #a67c52;
    padding-bottom: 3px;
}

/* =========================================
   3. PÁGINA DE GALERÍA (galeria.html, ines_galeria.html)
   ========================================= */
.gallery-page {
    font-family: 'Georgia', serif;
    background-color: #f4f4f4;
    color: #333;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}
.gallery-page header {
    background-color: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-bottom: 4px solid #18222c;
}
.gallery-page h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: normal;
    letter-spacing: 1px;
}
.gallery-page .container {
    max-width: 1200px;
    margin: auto;
    padding: 0 20px;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding-bottom: 40px;
}
.gallery-item {
    background: #fff;
    border: 1px solid #eaeaea;
    box-shadow: none; /* Sin sombra estática */
    border-radius: 0; /* Bordes rectos en la galería */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.05); /* Sombra muy elegante solo al pasar el ratón */
}
.image-wrapper {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background-color: #eaeaea;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.gallery-item:hover img {
    transform: scale(1.05);
}
.item-title {
    padding: 15px;
    text-align: center;
    font-size: 0.95rem;
    color: #444;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #eee;
}

/* Modal Lightbox (Galería) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal.show {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 1;
}
.modal-content {
    max-width: 90%;
    max-height: 80vh;
    border: 2px solid #555;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
.modal-caption {
    margin-top: 15px;
    color: #ddd;
    font-size: 1.2rem;
    text-align: center;
    max-width: 80%;
}
.close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    font-family: sans-serif;
}
.close-btn:hover, .close-btn:focus {
    color: #bbb;
    text-decoration: none;
}
.nav-btn {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 40px;
    transition: 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
}
.prev-btn { left: 20px; border-radius: 3px; }
.next-btn { right: 20px; border-radius: 3px; }
.nav-btn:hover { background-color: rgba(0,0,0,0.8); }

.gallery-page nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    padding: 20px 0;
    margin: 0;
    justify-content: center;
}
.gallery-page nav a {
    text-decoration: none;
    color: #ecf0f1;
    font-weight: bold;
    text-transform: uppercase;
    transition: color 0.3s ease, border-bottom 0.3s ease;
}
.gallery-page nav a:hover {
    color: #a67c52;
}
.gallery-page nav a.active {
    color: #fff;
    border-bottom: 2px solid #fff;
    padding-bottom: 3px;
}

/* =========================================
   4. PÁGINA DE CONTACTO (contacto.html)
   ========================================= */
.contact-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 20px;
}
.contact-info {
    text-align: center;
}
.contact-info .btn {
    margin: 5px;
}
.contact-details {
    margin-top: 30px;
}
.contact-details p {
    margin: 10px 0;
    color: #444;
}
.contact-details a {
    color: #444;
    text-decoration: none;
    transition: color 0.3s;
}
.contact-details a:hover {
    color: #a67c52;
}
.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
}
.social-links a {
    color: #1a1a1a;
    font-size: 1.5rem;
    transition: color 0.3s, transform 0.3s;
}
.social-links a:hover {
    color: #a67c52;
    transform: translateY(-3px);
}
.map-frame {
    border-radius: 0; /* Mapa con bordes rectos */
    overflow: hidden;
    box-shadow: none; /* Sin sombra en el mapa */
    border: 1px solid #eaeaea;
}
.btn-whatsapp {
    background-color: #25d366 !important;
}
.btn-whatsapp:hover {
    background-color: #1da851 !important;
}

/* =========================================
   5. PÁGINA DE CARRUSEL 3D (carrusel.html)
   ========================================= */
.carrusel-page main.container {
    text-align: center;
    margin-top: 20px;
}

.carousel-3d-container {
    position: relative;
    width: 100%;
    height: 380px;
    margin: 30px auto;
    perspective: 1200px; /* Profundidad 3D */
    display: flex;
    justify-content: center;
    align-items: center;
}

.carousel-3d {
    position: relative;
    width: 200px;
    height: 280px;
    transform-style: preserve-3d;
    animation: rotate3D 25s linear infinite; /* Rotación continua lenta */
}

/* Pausar animación al pasar el mouse */
.carousel-3d-container:hover .carousel-3d {
    animation-play-state: paused;
}

.slide-3d {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: center;
    /* 360 grados / 10 imágenes = 36 grados de diferencia por imagen. */
    transform: rotateY(calc(var(--i) * 36deg)) translateZ(320px);
    cursor: pointer;
    -webkit-box-reflect: below 5px linear-gradient(transparent, transparent, rgba(0,0,0,0.15));
}

.slide-3d img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border-radius: 8px;
    transition: transform 0.3s, border-color 0.3s;
}

.slide-3d:hover img {
    transform: scale(1.08); /* Crece un poquito al pasar el ratón */
    border-color: #a67c52;
}

@keyframes rotate3D {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

/* Modal de ampliación para el Carrusel 3D */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
}

.image-modal.show {
    display: flex;
}

.image-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    border: 2px solid #555;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border-radius: 4px;
    object-fit: contain;
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 2001;
    transition: color 0.3s;
    user-select: none;
}

.image-modal-close:hover {
    color: #a67c52;
}