/* Basic Reset & Body Style */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'EB Garamond', serif;
    background-color: #e8e4d8; /* Aged paper color */
    color: #3a3a3a; /* Dark grey/brown text */
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 20px auto;
    background-color: #fdfcf7; /* Slightly lighter paper */
    padding: 30px;
    border: 1px solid #c9c1a5; /* Subtle border */
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.1);
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #b0a88e;
    padding-bottom: 15px;
    position: relative;
}

header h1 {
    font-family: 'Special Elite', cursive;
    font-size: 3.5em;
    color: #5a4e4d;
    margin-bottom: 0;
    letter-spacing: 2px;
}

header h2 {
    font-family: 'EB Garamond', serif;
    font-size: 1.5em;
    color: #776e64;
    font-weight: normal;
    margin-top: 5px;
}

.confidential-stamp {
    font-family: 'Special Elite', cursive;
    border: 3px double #a03030; /* Dark red border */
    color: #a03030;
    padding: 5px 15px;
    display: inline-block;
    margin-top: 15px;
    font-size: 1.2em;
    transform: rotate(-5deg);
    opacity: 0.8;
}

/* Section Styles */
section {
    margin-bottom: 40px;
    padding: 20px;
    border: 1px dashed #d1c9ae; /* Dashed border for sections */
    background-color: #f9f6f0; /* Very light cream */
}

section h3 {
    font-family: 'Special Elite', cursive;
    font-size: 1.8em;
    color: #605554;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 1px solid #ccc;
    padding-bottom: 10px;
}

/* User Input Section */
#user-input {
    text-align: center;
    background-color: #f0ebe0;
}
#user-input label {
    font-weight: bold;
    margin-right: 10px;
    font-size: 1.1em;
}
#user-input input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #c9c1a5;
    font-family: 'EB Garamond', serif;
    font-size: 1em;
    width: 250px;
    margin-right: 10px;
}
#user-input button {
    font-family: 'Special Elite', cursive;
    padding: 8px 20px;
    background-color: #776e64; /* Muted brown/grey */
    color: #fdfcf7;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}
#user-input button:hover {
    background-color: #5a4e4d;
}

/* Video Styles */
#video-container {
    position: relative;
    margin-bottom: 20px;
    background: #333; /* Dark background for video area */
    padding: 10px;
    border: 5px solid #555;
}

/* Hidden Class */
#video-quiz-section.hidden,
#gallery.hidden,
#timeline.hidden,
#actors.hidden,
#story.hidden,
#results.hidden {
    display: none;
}

/* Timeline Styles */
.timeline-list {
    list-style: none;
    padding-left: 20px;
    position: relative;
}
.timeline-list::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #b0a88e;
}
.timeline-list li {
    margin-bottom: 20px;
    position: relative;
    padding-left: 25px;
}
.timeline-list li::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 5px;
    width: 15px;
    height: 15px;
    background-color: #776e64;
    border-radius: 50%;
    border: 2px solid #fdfcf7;
}
.timeline-list li strong {
    display: block;
    font-weight: bold;
    color: #5a4e4d;
}

/* Actors Styles */
.actor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}
.actor-card {
    border: 1px solid #d1c9ae;
    padding: 15px;
    text-align: center;
    background-color: #fdfcf7;
}
.actor-card img {
    max-width: 100px;
    height: auto;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 3px solid #dcd6c0;
    filter: grayscale(100%) sepia(20%);
}
.actor-card h4 {
    font-family: 'Special Elite', cursive;
    margin-bottom: 5px;
    font-size: 1.3em;
    color: #605554;
}

/* Story Styles */
#story article {
    margin-top: 20px;
}
#story h4 {
    font-family: 'Special Elite', cursive;
    font-size: 1.4em;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #605554;
}
#story p {
    margin-bottom: 15px;
    text-align: justify;
}

/* Results Styles */
#results {
    background-color: #f0ebe0;
    text-align: center;
}
#results-text {
    font-size: 1.2em;
    margin-bottom: 20px;
}

/* Galería de Fotos */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    /* Se elimina la altura fija de aquí */
}

.photo-grid img {
    width: 100%;
    height: 180px; /* Altura base para escritorio */
    object-fit: cover;
    border: 4px solid #dcd6c0;
    padding: 5px;
    background-color: #fff;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    filter: grayscale(80%) sepia(30%);
    transition: transform 0.3s ease, filter 0.3s ease;
    cursor: pointer;
}

.photo-grid img:hover {
    transform: scale(1.05);
    filter: grayscale(0%) sepia(0%);
}

/* Estilos del Modal (Lightbox) */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 50px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
}
.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 85vh;
  animation-name: zoom;
  animation-duration: 0.4s;
}
@keyframes zoom {
  from {transform:scale(0)}
  to {transform:scale(1)}
}
.close-modal {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}
.close-modal:hover,
.close-modal:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}
@media (max-width: 700px){
  .modal-content {
    max-width: 95%;
  }
}

/* Responsive Adjustments Generales */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.5em;
    }
    header h2 {
        font-size: 1.2em;
    }
    .container {
        padding: 15px;
    }
    section {
        padding: 15px;
    }
    .photo-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        /* height: 150px; <-- ELIMINADO */
    }
    /* NUEVO: Ajustar altura de IMAGEN en tablet */
    .photo-grid img {
        height: 150px;
    }
    .actor-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2em;
    }
    .confidential-stamp {
        font-size: 1em;
    }
     #user-input input[type="text"] {
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0;
    }
     #user-input button {
        width: 100%;
    }
     .photo-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        /* height: 120px; <-- ELIMINADO */
        gap: 10px;
    }
    /* NUEVO: Ajustar altura de IMAGEN en móvil */
    .photo-grid img {
        height: 120px;
    }
}