/* =========================================================
   REGION PAGES — shared styles for all region subpages
   ========================================================= */

/* ----- HERO CAROUSEL ----- */
.rg-hero {
  position: relative;
  height: 58vh;
  min-height: 380px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.rg-hero-track {
  position: absolute;
  inset: 0;
}
.rg-hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.rg-hero-slide.active { opacity: 1; }
.rg-hero .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.15) 55%, transparent 100%);
  z-index: 1;
}
.rg-hero-content {
  position: relative;
  z-index: 2;
  padding: 0 4rem 2.8rem;
  color: #fff;
}
.rg-hero-title {
  font-family: var(--font-title);
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}
.rg-hero-sub {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: rgba(255,255,255,0.85);
}
.rg-hero-dots {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}

/* ----- CLIMATE ----- */
.rg-climate-section {
  padding: 2.8rem 0;
  background: var(--c3);
}
.rg-climate-grid {
  display: flex;
  justify-content: center;
  gap: 4rem;
  flex-wrap: wrap;
}
.rg-climate-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.rg-climate-item:hover { transform: scale(1.1); }

/* icon wrap — shared for climate, livestock, crops */
.rg-icon-wrap {
  width: 110px;
  height: 110px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rg-icon-wrap img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  position: absolute;
  top: 0; left: 0;
  transition: opacity 0.3s ease;
}
.rg-icon-wrap .icon-default { opacity: 1; }
.rg-icon-wrap .icon-color   { opacity: 0; }
.rg-climate-item:hover .icon-default,
.rg-icon-item:hover    .icon-default { opacity: 0; }
.rg-climate-item:hover .icon-color,
.rg-icon-item:hover    .icon-color   { opacity: 1; }

.rg-climate-label {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c2);
  max-width: 100px;
  line-height: 1.3;
}

/* ----- ABOUT (text + map) ----- */
.rg-about-section { padding: 2.5rem 0 4rem; }
.rg-about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.rg-about-text p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--c2);
}

/* Map trigger — clickable for lightbox */
.rg-map-trigger {
  position: relative;
  cursor: pointer;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  transition: box-shadow 0.3s;
}
.rg-map-trigger:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.18); }
.rg-map-trigger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 25% 8%;
  display: block;
  transition: transform 0.4s ease;
}
.rg-map-trigger:hover img { transform: scale(1.05); }
.rg-map-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(0,0,0,0);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  opacity: 0;
  transition: background 0.3s, opacity 0.3s;
}
.rg-map-trigger:hover .rg-map-hint {
  background: rgba(0,0,0,0.35);
  opacity: 1;
}
.rg-map-hint svg { width: 20px; height: 20px; }

/* ----- LIGHTBOX ----- */
.rg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.rg-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}
.rg-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.88);
}
.rg-lightbox-box {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  width: min(90vw, 820px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.rg-lightbox-close {
  position: absolute;
  top: 10px; right: 14px;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #555;
  z-index: 2;
  line-height: 1;
  transition: color 0.2s;
}
.rg-lightbox-close:hover { color: var(--c1); }
.rg-lightbox-viewport {
  overflow: hidden;
  cursor: grab;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  max-height: calc(90vh - 64px);
  user-select: none;
  background: #f8f8f8;
}
.rg-lightbox-viewport:active { cursor: grabbing; }
#lightboxImg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center;
  pointer-events: none;
  display: block;
}
.rg-lightbox-controls {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.65rem;
  border-top: 1px solid #eee;
  background: #fff;
}
.rg-lightbox-controls button {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1.5px solid #ddd;
  background: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
}
.rg-lightbox-controls button:hover {
  border-color: var(--c1);
  color: var(--c1);
}

/* ----- SECTION TITLE ----- */
.rg-section-title {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--c1);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4rem;
}

/* Iconos de ganadería más grandes */
.rg-icons-section:not(.alt) .rg-icon-wrap,
.rg-icons-section:not(.alt) .rg-icon-wrap img {
  width: 135px;
  height: 135px;
}
.rg-icons-section:not(.alt) .rg-section-title {
  margin-bottom: 2.5rem;
}

/* Iconos de cultivos */
.rg-icons-section.alt .rg-icon-wrap,
.rg-icons-section.alt .rg-icon-wrap img {
  width: 100px;
  height: 100px;
}

/* ----- ICONS GRID (livestock / crops) ----- */
.rg-icons-section {
  padding: 3.5rem 0 0;
  background: var(--c3);
}
.rg-icons-section.alt { background: var(--c3); }
.rg-icons-grid {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.rg-icons-grid--few { gap: 6rem; }

.rg-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  text-align: center;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.rg-icon-item:hover { transform: scale(1.12); }
.rg-icon-label {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c2);
  max-width: 90px;
  line-height: 1.3;
}

/* ----- PHOTO SLIDER ----- */
.rg-slider {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #cfd8c8;
}
.rg-slider-track {
  position: relative;
  width: 100%;
  height: 100%;
}
.rg-slide-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.9s ease;
  display: block;
}
.rg-slide-img.active { opacity: 1; }
.rg-slider-prev,
.rg-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.75);
  border: none;
  border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  padding-bottom: 2px;
}
.rg-slider-prev { left: 10px; }
.rg-slider-next { right: 10px; }
.rg-slider-prev:hover,
.rg-slider-next:hover { background: rgba(255,255,255,0.97); }
.rg-slider-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}
.rg-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}
.rg-dot.active { background: #fff; }

/* ----- PHOTO + TEXT ----- */
.rg-photo-text-section { padding: 4rem 0; }
.rg-photo-text-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.rg-photo-text-grid.reverse { direction: rtl; }
.rg-photo-text-grid.reverse > * { direction: ltr; }
.rg-text-body p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--c2);
}

/* ----- TEXT CENTER ----- */
.rg-text-center-section {
  padding: 2.5rem 0 3rem;
  text-align: center;
}
.rg-text-center-section p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--c2);
  max-width: 720px;
  margin: 0 auto;
}

/* ----- FUN FACTS ----- */
.rg-facts-section {
  background: var(--c1);
  padding: 4rem 0;
}
.rg-facts-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--c3);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 1.8rem;
}
.rg-facts-list {
  max-width: 640px;
  margin: 0 auto;
  padding-left: 1.5rem;
  list-style: disc;
}
.rg-facts-list li {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.65;
  margin-bottom: 0.6rem;
  color: rgba(255,255,255,0.93);
}

/* ----- CONTACT FORM ----- */
.rg-contact-section {
  padding: 5rem 0;
  background: var(--c3);
  text-align: center;
}
.rg-contact-section h2 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: var(--c1);
  margin-bottom: 2rem;
}
.rg-form {
  max-width: 680px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  text-align: left;
}
.rg-form-left {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.rg-form input,
.rg-form textarea {
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  outline: none;
  color: var(--c2);
  background: #fff;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.rg-form input:focus,
.rg-form textarea:focus { border-color: var(--c1); }
.rg-form-right textarea {
  height: 100%;
  min-height: 178px;
  resize: vertical;
}
.rg-form-submit {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 0.3rem;
}
.rg-form button {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.85rem 2.8rem;
  background: var(--c1);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.rg-form button:hover { background: #305c28; }

/* ----- RESPONSIVE ----- */
@media (max-width: 768px) {
  .rg-hero-title { font-size: 2rem; }
  .rg-hero-content { padding: 0 1.5rem 2rem; }
  .rg-about-grid,
  .rg-photo-text-grid { grid-template-columns: 1fr; gap: 2rem; }
  .rg-photo-text-grid.reverse { direction: ltr; }
  .rg-climate-grid { gap: 2rem; }
  .rg-form { grid-template-columns: 1fr; }
  .rg-form-right textarea { min-height: 120px; }
  .rg-icon-wrap,
  .rg-icon-wrap img { width: 70px; height: 70px; }
}
