/* Chimalfe Patagonia Lodge — visual refinement (site-beautify). Builds on Themify Ultra tokens. */

:root {
  --cp-brown: #3c2313;
  --cp-brown-mid: #5e4115;
  --cp-wine: #4d2022;
  --cp-accent: #bd521c;
  --cp-gold: #b89072;
  --cp-bg: #faf8f5;
  --cp-surface: #ffffff;
  --cp-text: #444444;
  --cp-muted: #6b6b6b;
  --cp-radius: 6px;
  --cp-shadow: 0 4px 24px rgba(60, 35, 19, 0.08);
  --cp-section-y: clamp(2.5rem, 5vw, 4.5rem);
  --cp-container: min(1140px, 92vw);
  --cp-header-content-gap: clamp(1.25rem, 2.5vw, 2rem);
}

html {
  scroll-behavior: auto;
}

body {
  font-size: 17px;
  line-height: 1.65;
  color: var(--cp-text);
  background-color: var(--cp-bg);
  -webkit-font-smoothing: antialiased;
}

body h1,
body h2,
body h3,
body .module-title {
  color: var(--cp-brown);
  letter-spacing: 0.02em;
  line-height: 1.25;
}

body h1,
body .page-title {
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
}

body h2,
body .module-title {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  margin-bottom: 0.75em;
}

body a {
  transition: color 0.2s ease;
}

body a:focus-visible,
body button:focus-visible,
#main-nav a:focus-visible {
  outline: 2px solid var(--cp-accent);
  outline-offset: 2px;
}

#headerwrap.fixed-header {
  background-color: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 0 rgba(60, 35, 19, 0.08);
}

body:not(.mobile_menu_active):not(.home) #headerwrap,
body:not(.mobile_menu_active).home #headerwrap.fixed-header {
  background-color: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 0 rgba(60, 35, 19, 0.06);
}

/* Split nav: theme sets #main-nav height:48px — forces Contact onto a second row */
body:not(.mobile_menu_active).header-menu-split #headerwrap #main-nav-wrap {
  width: 100%;
  max-width: min(1320px, 98vw);
  margin: 0 auto;
}

body:not(.mobile_menu_active).header-menu-split #headerwrap #main-nav-wrap #main-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  min-height: 56px;
  margin: 0 auto;
  gap: 0;
}

body:not(.mobile_menu_active).header-menu-split #headerwrap #main-nav > li {
  flex: 0 1 auto;
  float: none;
}

body:not(.mobile_menu_active).header-menu-split #headerwrap #main-nav > li:nth-child(1),
body:not(.mobile_menu_active).header-menu-split #headerwrap #main-nav > li:nth-child(2),
body:not(.mobile_menu_active).header-menu-split #headerwrap #main-nav > li:nth-child(3) {
  flex: 1 1 0;
  display: flex;
  justify-content: flex-end;
}

body:not(.mobile_menu_active).header-menu-split #headerwrap #main-nav > li:nth-child(5),
body:not(.mobile_menu_active).header-menu-split #headerwrap #main-nav > li:nth-child(6),
body:not(.mobile_menu_active).header-menu-split #headerwrap #main-nav > li:nth-child(7) {
  flex: 1 1 0;
  display: flex;
  justify-content: flex-start;
}

body:not(.mobile_menu_active).header-menu-split #headerwrap #main-nav .themify-logo-menu-item {
  flex: 0 0 auto;
  margin: 0 1rem;
  display: block;
}

body:not(.mobile_menu_active).header-menu-split #headerwrap #main-nav .themify-logo-menu-item #site-logo {
  max-width: min(200px, 22vw);
}

body:not(.mobile_menu_active).header-menu-split #headerwrap #main-nav > li > a {
  color: var(--cp-brown);
  font-size: clamp(0.68rem, 0.72vw + 0.55rem, 0.82rem);
  letter-spacing: 0.04em;
  padding: 0.55em 0.5em;
  white-space: nowrap;
  line-height: 1.2;
}

body:not(.mobile_menu_active).header-menu-split #headerwrap #main-nav > li > a:hover,
body:not(.mobile_menu_active).header-menu-split #headerwrap #main-nav .current-menu-item > a,
body:not(.mobile_menu_active).header-menu-split #headerwrap #main-nav .current_page_item > a {
  color: var(--cp-accent);
}

/* White logo PNG: darken on light header (inner pages + scrolled home) */
body:not(.mobile_menu_active):not(.home) #headerwrap #site-logo img,
body:not(.mobile_menu_active).home #headerwrap.fixed-header #site-logo img {
  filter: brightness(0) saturate(100%) invert(14%) sepia(35%) saturate(1800%) hue-rotate(358deg)
    brightness(0.42);
}

body:not(.mobile_menu_active) #headerwrap #site-logo img {
  max-height: 58px;
  width: auto;
  height: auto;
}

/* Home hero: light links over photography */
body:not(.mobile_menu_active).home #headerwrap:not(.fixed-header) #main-nav > li > a {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

body:not(.mobile_menu_active).home #headerwrap:not(.fixed-header) #main-nav > li > a:hover,
body:not(.mobile_menu_active).home #headerwrap:not(.fixed-header) #main-nav .current-menu-item > a {
  color: var(--cp-gold);
}

body:not(.mobile_menu_active).home #headerwrap:not(.fixed-header) #site-logo img {
  filter: none;
}

body:not(.mobile_menu_active).transparent-header:not(.home) #headerwrap {
  color: var(--cp-brown);
}

body:not(.mobile_menu_active).transparent-header.themify_builder_active:not(.home) #headerwrap {
  position: relative;
}

body:not(.mobile_menu_active).home.transparent-header #headerwrap:not(.fixed-header) {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(12, 8, 6, 0.55) 0%, rgba(12, 8, 6, 0.15) 70%, transparent 100%);
  box-shadow: none;
}

body:not(.mobile_menu_active) #headerwrap #header {
  padding: 0.65rem 0.75rem;
}

body.home #body {
  padding-top: 0;
}

body:not(.home) #body {
  padding-top: 0;
}

/* Inner pages: sticky header (no fixed/absolute toggle jump) */
body:not(.home).transparent-header #headerwrap,
body:not(.home) #headerwrap.fixed-header,
body:not(.home) #headerwrap {
  position: sticky !important;
  top: 0;
  left: auto;
  right: auto;
  z-index: 1000;
  width: 100%;
}

body.themify_builder_active #pagewrap {
  padding-top: 0 !important;
}

body:not(.home).fixed-header-on #pagewrap {
  padding-top: 0 !important;
}

#headerwrap {
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

#site-logo img {
  transition: filter 0.2s ease;
}

body:not(.home) #content {
  padding-top: 0;
}

/* Home hero: row background slider is JS-driven — static fallback + min height */
.home .themify_builder_211_row.module_row_0.module_row {
  background-image: url("/assets/www.chimalfepatagonialodge.com/wp-content/uploads/2018/10/slide-01-1024x744.jpg");
  background-size: cover;
  background-position: center top;
  min-height: clamp(440px, 75vh, 820px);
}

.home .themify_builder_211_row.module_row_0 .row-slider,
.home .themify_builder_211_row.module_row_0 .builder_row_cover {
  min-height: inherit;
}

#content {
  max-width: var(--cp-container);
  margin-left: auto;
  margin-right: auto;
}

.themify_builder_row.module_row {
  padding-top: 0;
  padding-bottom: var(--cp-section-y);
}

.themify_builder_row.module_row + .themify_builder_row.module_row {
  padding-top: var(--cp-section-y);
}

/* Inner pages: breathing room below header, tight title→content (not huge hero gap) */
body:not(.home) .page-content > .themify_builder_content > .themify_builder_row.module_row:first-child {
  padding-top: var(--cp-header-content-gap);
}

body:not(.home) .page-content > .themify_builder_content > .themify_builder_row.module_row_0 {
  padding-bottom: 0.5rem;
}

body:not(.home) .page-content > .themify_builder_content > .themify_builder_row.module_row_0 + .themify_builder_row {
  padding-top: 1.25rem;
}

body:not(.home) .module_row_0.fullcover .module-text h2,
body:not(.home) .module_row_0.fullcover .module-text h1 {
  margin-top: 0.25rem;
  margin-bottom: 0;
}

body:not(.home) .module_row_0.fullcover > .row-slider {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body:not(.home) .module_row_0.fullcover {
  position: relative;
  min-height: 0;
  padding-bottom: 0.5rem;
}

body:not(.home) .module_row_0.fullcover .row_inner {
  position: relative;
  z-index: 1;
}

.themify_builder_row.module_row .row_inner {
  max-width: var(--cp-container);
  margin-left: auto;
  margin-right: auto;
}

.themify_builder_content p {
  max-width: 42em;
}

.themify_builder_content .module-text p {
  margin-bottom: 1em;
}

.ui.builder_button,
.button,
input[type="submit"],
button {
  border-radius: var(--cp-radius);
  padding: 0.75em 1.35em;
  min-height: 44px;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.ui.builder_button:hover,
.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--cp-shadow);
}

img.wp-post-image,
.themify_builder_content img {
  border-radius: var(--cp-radius);
}

.gallery-icon img,
.module-gallery img,
.masonry img {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.gallery-icon a:hover img,
.module-gallery a:hover img {
  transform: scale(1.02);
  box-shadow: var(--cp-shadow);
}

#footerwrap {
  background: linear-gradient(180deg, #f3efe9 0%, #ebe4db 100%);
  border-top: 1px solid rgba(60, 35, 19, 0.08);
  padding-top: 2.5rem;
  padding-bottom: 2rem;
}

#footer {
  max-width: var(--cp-container);
  margin: 0 auto;
}

#footer .widgettitle {
  color: var(--cp-wine);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

#footer .textwidget,
#footer .widget {
  font-size: 0.95rem;
  line-height: 1.6;
}

#footer a {
  color: var(--cp-brown-mid);
}

#footer a:hover {
  color: var(--cp-accent);
}

#footer-logo img {
  max-width: 200px;
  height: auto;
}

.sb_instagram_header,
#sb_instagram {
  max-width: var(--cp-container);
  margin: 0 auto;
}

.themify_builder_row.animated-bg {
  animation: none !important;
  background-color: transparent !important;
}

@media (max-width: 1100px) and (min-width: 681px) {
  body:not(.mobile_menu_active).header-menu-split #headerwrap #main-nav > li > a {
    font-size: 0.68rem;
    padding: 0.5em 0.35em;
  }

  body:not(.mobile_menu_active).header-menu-split #headerwrap #main-nav .themify-logo-menu-item {
    margin: 0 0.35rem;
  }
}

@media (max-width: 900px) {
  #site-logo img {
    max-height: 56px;
  }

  .themify_builder_row.module_row {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  #pagewrap {
    overflow-x: hidden;
  }
}

#footer .footer-left-wrap,
#footer .footer-right-wrap {
  padding: 0.5rem 1rem;
}

#footer .footer-widgets {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  justify-content: flex-start;
}

#footer .fa {
  color: var(--cp-accent);
  margin-right: 0.35em;
}

.module-gallery .gallery-item,
.masonry .post {
  margin-bottom: 0.75rem;
}

.gutter.masonry .post {
  border-radius: var(--cp-radius);
  overflow: hidden;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 textarea {
  border: 1px solid rgba(60, 35, 19, 0.2);
  border-radius: var(--cp-radius);
  padding: 0.65em 0.85em;
  font-size: 1rem;
  width: 100%;
  max-width: 32em;
}

.wpcf7 input[type="submit"] {
  background-color: var(--cp-accent);
  color: #fff;
  border: none;
  cursor: pointer;
}

.wpcf7 input[type="submit"]:hover {
  background-color: var(--cp-brown-mid);
}

.page-title,
#content .page-title {
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--cp-gold);
  display: inline-block;
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  #main-nav a {
    padding: 0.85em 1em;
  }
}
