/* Hoja de Trabajo 1 - Excursión al Lago de Atitlán
   Estilo sobrio: paleta neutra, tipografía clara, layout simple */

:root {
  --color-bg: #f6f5f2;
  --color-surface: #ffffff;
  --color-text: #2b2b2b;
  --color-muted: #6b6b6b;
  --color-accent: #3f5d63;
  --color-accent-dark: #2c4246;
  --color-border: #dedad3;

  --font-heading: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Poppins", "Segoe UI", Arial, sans-serif;

  --radius: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
}

h1, h2 {
  font-family: var(--font-heading);
  color: var(--color-accent-dark);
  margin-top: 0;
}

a {
  color: var(--color-accent);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-accent-dark);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection {
  background-color: var(--color-accent);
  color: #fff;
}

/* Hero */
.hero {
  text-align: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-surface);
}

.hero picture {
  display: block;
  width: 100%;
  height: clamp(180px, 28vw, 380px);
  overflow: hidden;
}

.hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 65%;
}

.hero-text {
  padding: 1.5rem 1rem 0.5rem;
}

.hero-text h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: 0.03em;
}

.hero-text .subtitle {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 500;
  color: var(--color-muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.hero-text::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  margin: 1rem auto 0;
  background-color: var(--color-accent);
  border-radius: 2px;
}

/* Navegación */
.site-nav {
  max-width: 640px;
  margin: 2rem auto;
  padding: 1.25rem 1.5rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.site-nav h2 {
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 1rem;
}

.site-nav ol {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li a {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.9rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.site-nav li a:hover {
  background-color: var(--color-accent);
  color: #fff;
}

/* Secciones generales */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

.section {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin: 2rem 0;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease;
}

.section:hover {
  box-shadow: 0 6px 16px rgba(44, 66, 70, 0.12);
}

.section h2 {
  position: relative;
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
}

.section h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 3px;
  background-color: var(--color-accent);
  border-radius: 2px;
}

.section-intro {
  text-align: center;
  color: var(--color-muted);
  margin-top: -0.5rem;
}

.back-link {
  text-align: center;
  margin: 1.5rem 0;
}

.back-link a {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.back-link a:hover {
  background-color: var(--color-accent);
  color: #fff;
}

/* Galería - estilo bento grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 140px;
  gap: 1rem;
  margin-top: 1.25rem;
}

.gallery figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.gallery figure:nth-child(1) {
  grid-column: 1 / 3;
  grid-row: 1 / 3;
}

.gallery figure:nth-child(2) {
  grid-column: 3 / 5;
  grid-row: 1 / 2;
}

.gallery figure:nth-child(3) {
  grid-column: 3 / 4;
  grid-row: 2 / 3;
}

.gallery figure:nth-child(4) {
  grid-column: 4 / 5;
  grid-row: 2 / 3;
}

.gallery figure a {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

.gallery figure a::after {
  content: "\26F6";
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-radius: 50%;
  font-size: 0.9rem;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.gallery figure:hover a::after,
.gallery figure a:focus-visible::after {
  opacity: 1;
  transform: scale(1);
}

.gallery picture {
  display: block;
  width: 100%;
  height: 100%;
}

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

.gallery figure:hover img {
  transform: scale(1.06);
}

.gallery figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.5rem 0.75rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));
}

.credits {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--color-muted);
  text-align: center;
}

/* Lightbox de imágenes (solo CSS, vía :target) */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 2.5rem 1.5rem;
  border: none;
  background-color: rgba(10, 14, 15, 0.733);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.lightbox:target {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.lightbox img {
  position: relative;
  z-index: 1;
  max-width: min(90vw, 900px);
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.lightbox-caption {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 1.75rem;
  margin: 0;
  text-align: center;
  color: #f0efe9;
  font-weight: 500;
  pointer-events: none;
}

.lightbox-close {
  position: absolute;
  z-index: 1;
  top: 1.25rem;
  right: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Tabla de itinerario */
.itinerary-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.25rem;
}

.itinerary-table caption {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--color-accent-dark);
}

.itinerary-table th,
.itinerary-table td {
  border: 1px solid var(--color-border);
  padding: 0.6rem 0.75rem;
  text-align: left;
}

.itinerary-table th {
  background-color: var(--color-accent);
  color: #fff;
  font-weight: 600;
}

.itinerary-table tbody tr:nth-child(even) {
  background-color: var(--color-bg);
}

.itinerary-table tbody tr {
  transition: background-color 0.2s ease;
}

.itinerary-table tbody tr:hover {
  background-color: #eef3f2;
}

.itinerary-table td:first-child,
.itinerary-table td:nth-child(2) {
  text-align: center;
  white-space: nowrap;
}

/* Actividades y recomendaciones */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.two-col .section {
  margin: 0;
}

.two-col ul {
  padding-left: 1.25rem;
  margin: 0;
}

.two-col li {
  margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 2rem;
  background-color: var(--color-accent-dark);
  color: #f0efe9;
  border-top: 3px solid var(--color-accent);
}

.site-footer p {
  margin: 0.35rem 0;
}

.site-footer a {
  color: #cfe0e2;
}

.site-footer a:hover {
  color: #ffffff;
}

/* Responsive */
@media (max-width: 700px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 160px;
  }

  .gallery figure:nth-child(1) {
    grid-column: 1 / 3;
    grid-row: 1 / 2;
  }

  .gallery figure:nth-child(2),
  .gallery figure:nth-child(3),
  .gallery figure:nth-child(4) {
    grid-column: span 1;
    grid-row: auto;
  }
}

@media (max-width: 460px) {
  .gallery {
    grid-template-columns: 1fr;
  }

  .gallery figure:nth-child(1),
  .gallery figure:nth-child(2),
  .gallery figure:nth-child(3),
  .gallery figure:nth-child(4) {
    grid-column: 1 / 2;
    grid-row: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}
