/* ==========================================================================
   Abajo Haven Guest Cabins — static site stylesheet
   Rebuilt from the WordPress (Astra + Elementor) design by ONNA Web Design.
   ========================================================================== */

/* ---------- Fonts (self-hosted, variable woff2, latin subset) ---------- */
@font-face {
  font-family: 'Andada Pro';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/andada-pro-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/karla-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Karla';
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/karla-italic-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/fonts/open-sans-latin.woff2') format('woff2');
}

/* ---------- Design tokens (from the original Astra global colors) ---------- */
:root {
  --rust: #a55848;          /* global color 0 */
  --rust-light: #bb6451;    /* global color 1 */
  --rust-dark: #8a4c3f;
  --sage: #92a475;          /* global color 2 (decorative only — too light for white text) */
  --sage-btn: #66764d;      /* darkened sage so white button text meets WCAG AA (4.9:1) */
  --sage-btn-hover: #535f3e;
  --charcoal: #1e1715;      /* global color 6 */
  --text: #352a26;          /* global color 7 */
  --white: #ffffff;
  --page-bg: #f6fbfb;       /* rgba(233,244,245,.42) over white */
  --container: 1320px;      /* 1280px content + 2 × 20px gutters, as in the original */
  --gutter: 20px;
  --font-body: 'Karla', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Andada Pro', Georgia, 'Times New Roman', serif;
  --font-ui: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--page-bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rust); text-underline-offset: 2px; }
a:hover, a:focus { color: var(--rust-dark); }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul { margin: 0 0 1em; padding-left: 1.4em; }
ul:last-child { margin-bottom: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 400;
  color: var(--text);
  margin: 0 0 20px;
  line-height: 1.2;
}
h1 { font-size: 3.125rem; }   /* 50px */
h2 { font-size: 2.625rem; line-height: 1.3; }   /* 42px */
h3 { font-size: 2rem; line-height: 1.3; }       /* 32px */
h4 { font-size: 1.5rem; }                       /* 24px */
.h-sm { font-size: 1.8em; }   /* smaller section headings used on the home page */
.subprice { font-size: 20px; }
/* Heading-size utilities (scale down with the h3/h4 breakpoints below) */
.size-h3 { font-size: 2rem; line-height: 1.3; }
.size-h4 { font-size: 1.5rem; line-height: 1.3; }
.price { font-family: var(--font-head); margin: 0; }
.label-heading { font-family: var(--font-body); font-size: 1rem; font-weight: 700; line-height: 1.5; margin: 0 0 1em; }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}
.site-header :focus-visible, .page-hero :focus-visible, .site-footer :focus-visible {
  outline-color: #fff;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 10px; top: -60px; z-index: 1000;
  background: var(--white); color: var(--text);
  padding: 10px 16px; font-weight: 700; text-decoration: none;
  border-radius: 3px;
}
.skip-link:focus { top: 10px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.75rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-decoration: none;
  color: var(--white);
  background: var(--sage-btn);
  border: 1px solid var(--sage-btn);
  padding: 18px 32px;
  transition: background-color .2s, border-color .2s;
}
.btn:hover, .btn:focus { color: var(--white); background: var(--sage-btn-hover); border-color: var(--sage-btn-hover); }
.btn-rust { background: var(--rust); border-color: var(--white); font-size: 0.9375rem; padding: 14px 28px; }
.btn-rust:hover, .btn-rust:focus { background: var(--rust-dark); border-color: var(--white); }
.btn-wrap { margin-top: 10px; }

/* ==========================================================================
   Header (overlays the hero image, like the original transparent header)
   ========================================================================== */
.site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 100;
  color: var(--white);
}
.topbar {
  background: rgba(138, 76, 63, 0.83);
  border-bottom: 1px solid rgba(255, 255, 255, 0.23);
  font-size: 0.875rem;
}
.topbar .container {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 50px; gap: 20px;
}
.topbar a { color: var(--white); text-decoration: none; }
.topbar a:hover, .topbar a:focus { text-decoration: underline; color: var(--white); }
.topbar-contact { display: flex; align-items: center; gap: 20px; }
.topbar-social svg { width: 18px; height: 18px; fill: var(--white); display: block; }

.mainbar { background: rgba(166, 88, 73, 0.75); }
.mainbar .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 90px; gap: 20px;
}
.site-title {
  font-family: var(--font-head);
  font-size: 1.625rem;
  line-height: 1.1;
  margin: 0;
  font-weight: 400;
}
.site-title a { color: var(--white); text-decoration: none; }
.site-title a:hover, .site-title a:focus { color: rgba(255,255,255,.9); }

/* Primary navigation (desktop) */
.primary-nav { display: flex; align-items: center; gap: 24px; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.menu > li { position: relative; }
.menu a, .submenu-toggle {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--white);
  text-decoration: none;
}
.menu > li > a, .submenu-toggle {
  display: flex; align-items: center; gap: 6px;
  padding: 0 14px;
  line-height: 90px;
  background: none; border: 0; cursor: pointer;
}
.menu > li > a:hover, .submenu-toggle:hover,
.menu > li > a[aria-current="page"], .menu > li.is-current > .submenu-toggle {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 6px;
}
.submenu-toggle svg { width: 10px; height: 8px; transition: transform .2s; }
.submenu-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.submenu {
  list-style: none; margin: 0; padding: 0;
  position: absolute; top: 100%; left: 0;
  min-width: 230px;
  background: var(--rust);
  border-top: 2px solid var(--white);
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
  display: none;
}
.submenu a {
  display: block;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,.15);
  text-transform: none;
  font-size: 0.9375rem;
}
.submenu a:hover, .submenu a:focus, .submenu a[aria-current="page"] { background: var(--rust-dark); color: var(--white); }
/* Open on hover (mouse) and on click/keyboard (JS sets aria-expanded) */
@media (hover: hover) and (min-width: 922px) {
  .menu > li:hover > .submenu { display: block; }
}
.submenu-toggle[aria-expanded="true"] + .submenu { display: block; }

.header-book {
  font-size: 0.9375rem;
  padding: 16px 32px;
  border-color: var(--white);
}
.header-book:hover, .header-book:focus { border-color: var(--white); }

/* Mobile menu toggle (hamburger) */
.nav-toggle {
  display: none;
  background: var(--white);
  border: 0;
  width: 44px; height: 44px;
  padding: 10px;
  cursor: pointer;
  border-radius: 2px;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 20px; height: 2px; background: var(--text);
  position: relative; transition: transform .2s, background-color .2s;
}
.nav-toggle span::before, .nav-toggle span::after { content: ''; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

.mobile-contact { display: none; }

@media (max-width: 921px) {
  .topbar { display: none; }
  .mainbar .container { min-height: 70px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .site-title { font-size: 1.5rem; max-width: calc(100% - 64px); }
  .nav-toggle { display: block; }
  .primary-nav {
    display: none;
    width: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--rust);
    margin: 10px calc(var(--gutter) * -1) -10px;
    width: calc(100% + var(--gutter) * 2);
    /* A tall expanded menu scrolls inside itself (important in landscape) */
    max-height: calc(100vh - 80px);
    max-height: calc(100dvh - 80px);
    overflow-y: auto;
  }
  .primary-nav.is-open { display: flex; }
  .menu { flex-direction: column; align-items: stretch; }
  .menu > li > a, .submenu-toggle {
    line-height: 1.4; padding: 14px 25px; width: 100%;
    justify-content: space-between; font-size: 0.9375rem;
    border-bottom: 1px solid rgba(255,255,255,.15);
    text-align: left;
  }
  .submenu { position: static; border-top: 0; box-shadow: none; background: var(--rust-dark); }
  .submenu a { padding-left: 40px; }
  .header-book { margin: 16px 25px; text-align: center; }
  .mobile-contact {
    display: block; padding: 6px 25px 20px; color: var(--white);
    font-size: 0.9375rem; line-height: 1.8;
  }
  .mobile-contact p { margin: 0; }
  .mobile-contact strong { font-family: var(--font-head); font-size: 1.25rem; font-weight: 400; display: block; margin-bottom: 4px; }
  .mobile-contact a { color: var(--white); }
}

/* ==========================================================================
   Heroes
   ========================================================================== */
/* Shared: photo is an absolutely-positioned layer behind the content, so the
   band grows with its text instead of clipping a long, wrapped title. */
.hero-media { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after { content: ''; position: absolute; inset: 0; }

/* Home page hero */
.home-hero { position: relative; isolation: isolate; min-height: 800px; }
.home-hero .hero-media img { object-position: top center; }
.home-hero .hero-media::after { background: rgba(30, 23, 21, 0.2); }

/* Inner page title hero */
.page-hero {
  position: relative; isolation: isolate;
  min-height: 440px;            /* 140px header + 300px visible band */
  padding-top: 140px;
  display: flex; align-items: center;
}
.page-hero .hero-media::after { background: rgba(53, 42, 38, 0.8); }
.page-hero h1 { color: var(--white); margin: 30px 0; }

@media (max-width: 1024px) {
  .home-hero { min-height: 400px; }
  h1 { font-size: 2.8125rem; }  /* 45px */
  h2 { font-size: 2rem; }       /* 32px */
  h3 { font-size: 1.75rem; }    /* 28px */
  h4 { font-size: 1.375rem; }
  .size-h3 { font-size: 1.75rem; }
  .size-h4 { font-size: 1.375rem; }
}
@media (max-width: 921px) {
  .page-hero { min-height: 290px; padding-top: 90px; }
}
@media (max-width: 767px) {
  .home-hero { min-height: 300px; }
  .page-hero { min-height: 230px; }
  h1 { font-size: 2rem; }       /* 32px */
  h2 { font-size: 1.75rem; }    /* 28px */
  h3 { font-size: 1.375rem; }   /* 22px */
  h4 { font-size: 1.25rem; }
  .size-h3 { font-size: 1.375rem; }
  .size-h4 { font-size: 1.25rem; }
  .btn { padding: 15px 23px; }
}

/* ==========================================================================
   Sections & layout helpers
   ========================================================================== */
.section { padding: 60px 0; }
.section--white { background: var(--white); }
.section--tight-top { padding-top: 0; }
.section--loose-bottom { padding-bottom: 100px; }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: center;
}
.split--top { align-items: start; }
.split--33 { grid-template-columns: 1fr 2fr; }
.split--60 { grid-template-columns: 3fr 2fr; align-items: start; }
.split > * { min-width: 0; }
.col-pad { padding: 10px; }

.stack > * + * { margin-top: 20px; }

/* Home: intro block whose photo overlaps up into the hero */
.home-intro .container { display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
.home-intro-photo { margin-top: -200px; position: relative; z-index: 1; padding-right: 10px; }
.home-intro-photo img { border: 4px solid var(--white); width: 100%; }
.home-intro-text { padding: 10px 10px 10px 30px; }
.home-intro { padding-bottom: 80px; }

/* Card row (home "Near By", attractions grid) */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.card h3 { margin: 20px 0; }
.card--centered h3 { text-align: center; font-size: 26px; margin: 0 0 20px; }
.card--centered img { margin-bottom: 20px; aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }

.text-center { text-align: center; }
.lead-center h2 { text-align: center; font-size: 28px; }

/* Testimonials */
.testimonial { margin: 0; }
.testimonial blockquote { margin: 0 0 1em; font-style: italic; }
.testimonial figcaption { text-align: right; }

.green-note { color: #1d6b1d; font-weight: 700; }

/* Masonry photo galleries (cabins, region) */
.gallery, .gallery ul { list-style: none; margin: 0; padding: 0; }
.gallery { display: flex; gap: 10px; align-items: flex-start; }
.gallery-col { flex: 1 1 0; min-width: 0; }
.gallery-col li { margin-bottom: 10px; }
.gallery a { display: block; }
.gallery a:hover img, .gallery a:focus img { opacity: .88; }
.gallery img { width: 100%; }

/* Map */
.map-embed { position: relative; width: 100%; aspect-ratio: 4 / 3; min-height: 300px; }
.map-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

@media (max-width: 1024px) {
  .section { padding: 20px 0; }
  .section--loose-bottom { padding-bottom: 20px; }
  .home-intro-photo { margin-top: 0; }
  .home-intro { padding: 20px 0; }
}
@media (max-width: 767px) {
  .split, .split--33, .split--60, .home-intro .container { grid-template-columns: 1fr; }
  .split .order-first-mobile { order: -1; }
  .home-intro-text { padding: 10px; }
  .cards { grid-template-columns: 1fr; }
  /* Phones: let the photos flow into two balanced columns */
  .gallery { display: block; column-count: 2; column-gap: 10px; }
  .gallery-col, .gallery-col ul { display: contents; }
  .gallery-col li { break-inside: avoid; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
/* The footer photo is attached by main.js shortly before the footer scrolls
   into view (.bg-defer removed), so it never competes with the hero image. */
.site-footer.bg-defer { background-image: none !important; }
.site-footer {
  position: relative; isolation: isolate;
  color: var(--white);
  text-align: center;
  background-color: var(--charcoal);
  background-image: linear-gradient(rgba(31,23,21,.67), rgba(31,23,21,.67)), url('/images/desert-01-1400.webp');
  background-size: cover;
  background-position: center top;
}
@media (min-width: 1401px) {
  .site-footer { background-image: linear-gradient(rgba(31,23,21,.67), rgba(31,23,21,.67)), url('/images/desert-01.webp'); }
}
@media (max-width: 767px) {
  .site-footer { background-image: linear-gradient(rgba(31,23,21,.67), rgba(31,23,21,.67)), url('/images/desert-01-1000.webp'); }
}
.footer-main { padding: 110px 0 80px; line-height: 1.86; }
.footer-main h2 { color: var(--white); font-size: 2.625rem; margin-bottom: 20px; }
.footer-main .footer-phone { font-family: var(--font-head); font-size: 2.625rem; line-height: 1.3; margin: 10px 0 0; }
.footer-main address { font-style: normal; font-family: var(--font-head); font-size: 20px; line-height: 1.3; }
.footer-main a { color: var(--white); text-decoration: none; }
.footer-main a:hover, .footer-main a:focus { text-decoration: underline; color: rgba(255,255,255,.85); }
.footer-main .btn-rust { margin-top: 20px; }
.footer-main .btn-rust:hover, .footer-main .btn-rust:focus { text-decoration: none; color: var(--white); }
.footer-bottom {
  background: rgba(15, 17, 23, 0.7);
  border-top: 1px solid var(--sage);
  min-height: 50px;
  display: flex; align-items: center; justify-content: center;
  padding: 28px var(--gutter);
  font-size: 0.875rem;
  color: #e3eced;
}
.footer-bottom p { margin: 0; }
.footer-bottom a { color: #c9e2ff; }
.footer-bottom a:hover, .footer-bottom a:focus { color: var(--white); }
@media (max-width: 1024px) {
  .footer-main h2, .footer-main .footer-phone { font-size: 2rem; }
}
@media (max-width: 767px) {
  .footer-main { padding: 50px 0; }
  .footer-main h2, .footer-main .footer-phone { font-size: 1.75rem; }
}

/* ==========================================================================
   Lightbox (progressive enhancement for gallery links)
   ========================================================================== */
.lightbox {
  border: 0; padding: 0; margin: auto;
  max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh;
  background: transparent;
}
.lightbox::backdrop { background: rgba(0,0,0,.9); }
.lightbox-inner {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 50px 60px;
}
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lightbox button {
  position: absolute; background: rgba(0,0,0,.5); color: #fff; border: 0;
  width: 48px; height: 48px; font-size: 28px; line-height: 1; cursor: pointer; border-radius: 50%;
}
.lightbox button:hover, .lightbox button:focus-visible { background: rgba(0,0,0,.85); }
.lightbox .lb-close { top: 10px; right: 10px; }
.lightbox .lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-count { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #fff; font-size: .875rem; }
@media (max-width: 600px) { .lightbox-inner { padding: 60px 8px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 80px 0; }
.notfound ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px; margin-top: 20px; }
