/* Santa Rosa Xochiac — Design System */

:root {
  --bosque: #0B2027;
  --pino: #35524A;
  --salvia: #DDE5D7;
  --arena: #F5F3EF;
  --cacao: #A67B5B;
  --blanco: #FFFFFF;
  --negro: #000000;

  --font-serif: 'Playfair Display', serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.2);

  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--bosque);
  background-color: var(--arena);
  overflow-x: hidden;
}
.serif { font-family: var(--font-serif); }
img { max-width: 100%; height: auto; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-small { max-width: 800px; margin: 0 auto; padding: 0 1.5rem; }

/* Typography */
.section-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--cacao);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--bosque);
}

.section-subtitle {
  font-size: 1.125rem;
  opacity: 0.8;
  margin-bottom: 3rem;
  max-width: 650px;
}

.section-subtitle.text-center {
  margin-left: auto;
  margin-right: auto;
}

.text-center { text-align: center; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
  min-height: 48px;
}

.btn-hero {
  background-color: var(--blanco);
  color: var(--bosque);
  font-weight: 600;
  font-size: 1.1rem;
  padding: 1rem 3rem;
  border-radius: var(--radius-xl);
}

.btn-hero:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

/* ============================
   LANGUAGE TOGGLE
   ============================ */
.lang-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 999;
  background: rgba(11, 32, 39, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--blanco);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-lg);
  padding: 0.5rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 1px;
}

.lang-toggle:hover {
  background: rgba(11, 32, 39, 0.95);
  border-color: var(--cacao);
  transform: scale(1.05);
}

/* ============================
   HERO — CINEMATIC FULLSCREEN
   ============================ */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(11, 32, 39, 0.85) 0%,
    rgba(11, 32, 39, 0.4) 40%,
    rgba(11, 32, 39, 0.1) 70%,
    transparent 100%
  );
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--blanco);
  padding: 0 1.5rem 8vh;
  max-width: 850px;
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 3px;
  opacity: 0.8;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 300;
  opacity: 0.9;
  margin-bottom: 2.5rem;
  line-height: 1.7;
  animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  animation: bounce 2s infinite;
}

.scroll-arrow {
  display: block;
  width: 24px;
  height: 24px;
  border-right: 2px solid rgba(255,255,255,0.6);
  border-bottom: 2px solid rgba(255,255,255,0.6);
  transform: rotate(45deg);
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* ============================
   COMMUNITY SECTION
   ============================ */
.community-section {
  padding: 6rem 0;
  background-color: var(--blanco);
}

.community-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 768px) {
  .community-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

.community-image-wrapper {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  align-self: center;
}

.community-image {
  width: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.community-image-wrapper:hover .community-image {
  transform: scale(1.03);
}

.community-title-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.community-title-row .section-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin-bottom: 0;
}

.community-logo {
  height: 55px;
  width: auto;
  flex-shrink: 0;
}

.community-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--bosque);
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.community-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  background-color: var(--salvia);
  color: var(--pino);
  border-radius: var(--radius-lg);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ============================
   FOREST DIVIDER
   ============================ */
.forest-divider {
  position: relative;
  height: 50vh;
  min-height: 350px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.forest-divider img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.divider-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 32, 39, 0.55);
}

.divider-quote {
  position: relative;
  z-index: 1;
  color: var(--blanco);
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-style: italic;
  text-align: center;
  padding: 0 2rem;
  max-width: 700px;
  line-height: 1.5;
}

/* ============================
   EXPERIENCES GRID
   ============================ */
.experiences-section {
  padding: 6rem 0;
  background-color: var(--arena);
}

.experiences-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2rem;
}

.experience-card {
  background: var(--blanco);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.experience-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
}

.experience-image-wrapper {
  height: 220px;
  overflow: hidden;
}

.experience-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.experience-card:hover .experience-image {
  transform: scale(1.08);
}

.experience-content {
  padding: 1.75rem;
  flex-grow: 1;
}

.experience-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--bosque);
  margin-bottom: 0.75rem;
}

.experience-desc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--pino);
}

/* ============================
   IMPACT SECTION
   ============================ */
.impact-section {
  padding: 5rem 0;
  background: linear-gradient(135deg, var(--bosque) 0%, var(--pino) 100%);
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  text-align: center;
  margin-top: 3rem;
}

.impact-card {
  animation: fadeInUp 0.8s ease-out;
}

.impact-number {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--blanco);
  margin-bottom: 0.5rem;
}

.impact-label {
  font-size: 1rem;
  color: var(--salvia);
}

/* ============================
   GALLERY — MASONRY
   ============================ */
.gallery-section {
  padding: 6rem 0 0;
  background-color: var(--blanco);
}

.gallery-full {
  padding: 3rem 1.5rem 6rem;
  max-width: 1400px;
  margin: 0 auto;
}

.gallery-masonry {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 220px;
  gap: 1rem;
}

.gallery-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.gallery-item.gallery-tall {
  grid-row: span 2;
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  cursor: pointer;
}

.gallery-image:hover {
  transform: scale(1.05);
}

@media (max-width: 900px) {
  .gallery-masonry {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 200px;
  }
}

@media (max-width: 480px) {
  .gallery-masonry {
    grid-template-columns: 1fr;
    grid-auto-rows: 240px;
  }

  .gallery-item.gallery-tall {
    grid-row: span 1;
  }
}

/* ============================
   MAP SECTION — ROUTES
   ============================ */
.map-section {
  padding: 6rem 0;
  background-color: var(--arena);
  position: relative;
}

.routes-map-container {
  position: relative;
  margin-top: 2rem;
}

.routes-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 800;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  width: 260px;
  max-height: calc(100% - 2rem);
  overflow: hidden;
  transition: width 0.3s ease, max-height 0.3s ease;
}

.routes-controls.collapsed {
  width: auto;
  max-height: none;
  overflow: visible;
}

.routes-controls.collapsed .controls-body {
  display: none;
}

.controls-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bosque);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.controls-toggle-btn:hover {
  background: rgba(0,0,0,0.03);
}

.controls-toggle-btn .toggle-icon {
  transition: transform 0.3s ease;
  font-size: 0.7rem;
}

.routes-controls.collapsed .controls-toggle-btn .toggle-icon {
  transform: rotate(180deg);
}

.controls-body {
  padding: 0.75rem 1rem 1rem;
  overflow-y: auto;
  max-height: 420px;
}

.controls-body::-webkit-scrollbar {
  width: 4px;
}

.controls-body::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 2px;
}

.routes-controls h3 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--bosque);
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--salvia);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--salvia);
  margin-bottom: 0.5rem;
}

.group-header h3 {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.group-header.senderos-heading {
  margin-top: 0.75rem;
  border-bottom-width: 1px;
}

.group-toggle-btn {
  background: var(--salvia);
  border: none;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--bosque);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  flex-shrink: 0;
}

.group-toggle-btn:hover {
  background: var(--pino);
  color: var(--blanco);
}

.group-toggle-btn.off {
  background: rgba(0,0,0,0.08);
  color: var(--pino);
}

.route-color-marker {
  background: none !important;
  color: #2d5016;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.route-toggle { margin-bottom: 0.25rem; }

.route-checkbox {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  padding: 0.3rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.route-checkbox:hover { background-color: rgba(0,0,0,0.04); }

.route-checkbox input[type="checkbox"] {
  accent-color: var(--pino);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.route-color {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.route-label {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--bosque);
  white-space: nowrap;
}

.route-desc {
  display: block;
  font-size: 0.7rem;
  color: var(--pino);
  opacity: 0.8;
  margin-top: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-legend {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--salvia);
}

.route-legend p {
  font-size: 0.7rem;
  margin-bottom: 0.25rem;
  color: var(--bosque);
}

.legend-seg {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  color: var(--pino);
  margin-right: 0.75rem;
}

.seg-line {
  display: inline-block;
  width: 20px;
  height: 0;
  border-top: 2px solid var(--pino);
}

.seg-line.seg-dashed { border-top-style: dashed; }
.seg-line.seg-dotted { border-top-style: dotted; }

.route-meta {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--salvia);
  font-size: 0.7rem;
  color: var(--pino);
  line-height: 1.5;
}

.routes-map {
  height: 600px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background-color: var(--salvia);
}

@media (max-width: 767px) {
  .routes-map { height: 500px; }

  .routes-controls {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 220px;
  }

  .controls-body {
    max-height: 320px;
  }
}

/* ============================
   DIRECTIONS SECTION
   ============================ */
.directions-section {
  padding: 6rem 0;
  background-color: var(--blanco);
}

.directions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
}

@media (min-width: 768px) {
  .directions-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 2rem 4rem;
  }

  .directions-visual {
    grid-column: 2;
    grid-row: 1;
  }

  .directions-text {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .directions-map {
    grid-column: 2;
    grid-row: 2;
  }
}

.directions-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--bosque);
  opacity: 0.9;
  margin-bottom: 2rem;
}

.direction-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.direction-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background-color: var(--arena);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}

.direction-card:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-md);
}

.direction-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.direction-card h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--bosque);
  margin-bottom: 0.15rem;
}

.direction-card p {
  font-size: 0.9rem;
  color: var(--pino);
}

.directions-visual {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.directions-image {
  width: 100%;
  height: 100%;
  min-height: 250px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.directions-visual:hover .directions-image {
  transform: scale(1.03);
}

.directions-map {
  height: 350px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background-color: var(--salvia);
}

.directions-map iframe {
  width: 100%;
  height: 100%;
  border: none;
}

@media (max-width: 767px) {
  .directions-map { height: 300px; }
}

/* ============================
   FAQ
   ============================ */
.faq-section {
  padding: 6rem 0;
  background-color: var(--arena);
}

.faq-list { margin-top: 3rem; }

.faq-item {
  background-color: var(--blanco);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.faq-item[open] { box-shadow: var(--shadow-md); }

.faq-question {
  padding: 1.25rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--bosque);
  cursor: pointer;
  transition: var(--transition);
  list-style: none;
  position: relative;
  padding-right: 3rem;
}

.faq-question::-webkit-details-marker { display: none; }

.faq-question::after {
  content: '+';
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--pino);
  transition: var(--transition);
}

.faq-item[open] .faq-question::after { content: '\2212'; }

.faq-question:hover { color: var(--pino); }

.faq-answer {
  padding: 0 1.5rem 1.25rem;
  color: var(--bosque);
  opacity: 0.9;
  line-height: 1.7;
}

/* ============================
   FOOTER
   ============================ */
.footer {
  padding: 3rem 0 2rem;
  background-color: var(--bosque);
  color: var(--blanco);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-logo {
  height: 80px;
  width: auto;
  margin-bottom: 0.75rem;
  background: rgba(255,255,255,0.95);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
}

.footer-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.footer-brand p {
  opacity: 0.7;
  font-size: 0.9rem;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-links a {
  font-size: 1.25rem;
  text-decoration: none;
  transition: var(--transition);
}

.social-links a:hover { transform: translateY(-3px); }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
}

.footer-nav a {
  color: var(--blanco);
  text-decoration: none;
  opacity: 0.7;
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-nav a:hover { opacity: 1; }

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
}

.footer-bottom p {
  opacity: 0.5;
  font-size: 0.85rem;
}

/* ============================
   ANIMATIONS
   ============================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================
   ACCESSIBILITY
   ============================ */
:focus-visible {
  outline: 3px solid var(--cacao);
  outline-offset: 2px;
}

@media print {
  .hero, .lang-toggle, .social-links { display: none; }
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 767px) {
  .hero-inner {
    padding: 0 1rem 6vh;
  }

  .community-image {
    height: auto;
  }

  .forest-divider {
    height: 35vh;
    min-height: 250px;
  }

  /* Impact — stack to single column on mobile */
  .impact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .impact-number {
    font-size: 2.5rem;
  }

  .experiences-grid {
    grid-template-columns: 1fr;
  }

  .direction-card {
    padding: 1rem;
  }

  /* Footer — fully centered */
  .footer-inner {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-nav {
    justify-content: center;
  }

  .social-links {
    justify-content: center;
  }

  .btn { min-height: 44px; }
}
