/* Variables */
:root {
  --primary-color: #5E4A3E;
  --primary-color-hover: #9a8a7e;
  --secondary-color: #FFF8E1;
  --secondary-color-hover: #FFCB21;
  --support-color: #4D4D4D;
  --background-color: #E6E4D9;
  --background-color-hover: #D7D3C1;
}

/* Text color classes */
.text-white,
.text-white h1,
.text-white h2,
.text-white h3,
.text-white p,
.text-white a {
  color: #ffffff;
}

.text-black,
.text-black h1,
.text-black h2,
.text-black h3,
.text-black p,
.text-black a {
  color: #000000;
}

.text-primary,
.text-primary h1,
.text-primary h2,
.text-primary h3,
.text-primary p,
.text-primary a {
  color: var(--primary-color);
}

.text-secondary,
.text-secondary h1,
.text-secondary h2,
.text-secondary h3,
.text-secondary p,
.text-secondary a {
  color: var(--secondary-color);
}

/* Background color classes */
.bg-primary {
  background-color: var(--primary-color);
}

.bg-secondary {
  background-color: var(--secondary-color);
}

.bg-support {
  background-color: var(--support-color);
}

.bg-background {
  background-color: var(--background-color);
}

.bg-white {
  background-color: #ffffff;
}

/* Fonts - font-display: swap ensures text is visible immediately */
@font-face {
  font-family: 'Roboto';
  src: url('/fonts/Roboto-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto';
  src: url('/fonts/Roboto-Light.ttf') format('truetype');
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto';
  src: url('/fonts/Roboto-Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Oswald';
  src: url('/fonts/Oswald-VariableFont_wght.ttf') format('truetype');
  font-display: swap;
}


/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  background-color: var(--background-color);
  color: #212529;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-color-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* Main content */
#page-content {
  position: relative;
}

/* All containers after hero - solid background that covers hero during scroll */
.block-hero ~ .container,
.block-hero ~ .block-centered-text,
.block-hero ~ .block-feature-list,
.block-hero ~ .block-gallery,
.block-hero ~ .block-divider {
  position: relative;
  z-index: 10;
  background-color: var(--background-color);
}

/* First container after hero gets padding-top for beige "frame" */
.block-hero + .container {
  padding-top: 50px;
}

/* Typography */
h1 {
  font-family: 'Oswald', sans-serif;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

h2 {
  font-family: 'Roboto', sans-serif;
  font-weight: 300;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--secondary-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1030;
}

.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 128px;
  position: relative;
}

.navbar-brand {
  display: flex;
  align-items: center;
  position: absolute;
  left: 20px;
}

.logo {
  width: 70px;
  height: 70px;
  background-color: var(--primary-color);
  -webkit-mask: url('/img/logo/rrlogosymbol.svg') center / contain no-repeat;
  mask: url('/img/logo/rrlogosymbol.svg') center / contain no-repeat;
}

.navbar-menu {
  display: flex;
  gap: 30px;
}

.nav-link {
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-color);
  padding: 10px 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color-hover);
}

/* Dropdown submenus */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--background-color);
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  padding: 8px 0;
  z-index: 100;
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-item {
  display: block;
  padding: 10px 20px;
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: var(--primary-color);
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.nav-dropdown-item:hover,
.nav-dropdown-item.active {
  background-color: var(--background-color-hover);
  color: var(--primary-color-hover);
}

.navbar-toggler {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}

.navbar-toggler span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--primary-color);
  transition: all 0.3s ease;
}

.navbar-spacer {
  height: 128px;
}

/* Loading */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--support-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Hero Block */
.block-hero {
  position: relative;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: right 50%;
  background-attachment: scroll;
  z-index: 0;
  will-change: transform;
}

.block-hero .overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 33, 32, 0.2);
  pointer-events: none;
}

.block-hero .content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--background-color);
  will-change: opacity;
  transition: opacity 0.05s ease-out;
}

.block-hero .content p {
  font-family: 'Roboto', sans-serif;
  font-weight: 300;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.block-hero .full-logo {
  width: 100%;
  height: 100px;
  margin: 0 auto 20px;
  background-color: var(--background-color);
  -webkit-mask: url('/img/logo/ruernaranchlogo.svg') center / contain no-repeat;
  mask: url('/img/logo/ruernaranchlogo.svg') center / contain no-repeat;
}

/* Container */
.container {
  width: 100%;
  padding: 0 12px;
}

/* Section spacing */
.container + .container,
.container + .block-centered-text,
.container + .block-feature-list,
.container + .block-gallery,
.block-centered-text + .container,
.block-feature-list + .container,
.block-gallery + .container,
.block-hero + .container,
.block-hero + .block-centered-text,
.block-hero + .block-feature-list,
.block-hero + .block-gallery {
  margin-top: 60px;
}

/* Two Column Block */
.block-two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
}

.block-two-column .text-column {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.block-two-column .image-column {
  display: grid;
  overflow: hidden;
}

.block-two-column .image-column > img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  grid-area: 1 / 1;
}

.block-two-column .text-column {
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.block-two-column.bg-support .text-column {
  background: var(--support-color);
  color: var(--secondary-color);
}

.block-two-column.bg-support .text-column h1,
.block-two-column.bg-support .text-column h2,
.block-two-column.bg-support .text-column h3,
.block-two-column.bg-support .text-column p {
  color: var(--secondary-color);
}

.block-two-column.bg-support .text-column .content-item {
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.block-two-column .text-column h1 {
  font-size: 28px;
  margin-bottom: 10px;
}

.block-two-column .text-column h2 {
  font-size: 16px;
  letter-spacing: 0.15em;
  margin-bottom: 30px;
}

.block-two-column .text-column .content-item {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.block-two-column .text-column .content-item:last-child {
  border-bottom: none;
}

.block-two-column .text-column .content-item h3 {
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 5px;
}

.block-two-column .text-column .content-item p {
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0.05em;
}

/* Three Column Block */
.block-three-column {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.block-three-column .column {
  position: relative;
  min-height: 400px;
}

.block-three-column .column.image-column {
  overflow: hidden;
}

.block-three-column .column.image-column img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.block-three-column .column.image-column .overlay-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.8);
  padding: 50px 20px;
  text-align: center;
  width: 80%;
  max-width: 250px;
}

.block-three-column .column.image-column .overlay-box h1 {
  font-size: 30px;
  margin-bottom: 15px;
}

.block-three-column .column.image-column .overlay-box a {
  font-size: 13px;
  border-bottom: 1px solid var(--primary-color);
  padding-bottom: 2px;
}

.block-three-column .column.text-column {
  background: var(--primary-color);
  color: var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.block-three-column .column.text-column .content {
  text-align: center;
  max-width: 300px;
}

.block-three-column .column.text-column h1 {
  font-size: 24px;
  margin-bottom: 10px;
}

.block-three-column .column.text-column h2 {
  font-size: 22px;
  letter-spacing: 0.15em;
  margin-bottom: 20px;
}

.block-three-column .column.text-column p {
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.05em;
}

.block-three-column .column.text-column a {
  display: inline-block;
  margin-top: 20px;
  font-size: 13px;
  border-bottom: 1px solid var(--secondary-color);
  padding-bottom: 2px;
}

/* Centered Text Block */
.block-centered-text {
  padding: 60px 40px;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.block-centered-text h1 {
  font-size: 28px;
  margin-bottom: 10px;
}

.block-centered-text h2 {
  font-size: 16px;
  letter-spacing: 0.15em;
  margin-bottom: 30px;
}

.block-centered-text p {
  font-size: 14px;
  line-height: 1.9;
  letter-spacing: 0.1em;
  margin-bottom: 15px;
}

/* Feature List Block */
.block-feature-list {
  padding: 60px;
  max-width: 600px;
  margin: 0 auto;
}

.block-feature-list.bg-support {
  background: var(--support-color);
  max-width: none;
}

.block-feature-list h1 {
  font-size: 28px;
  margin-bottom: 30px;
}

.block-feature-list .feature {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.block-feature-list .feature:last-child {
  border-bottom: none;
}

.block-feature-list .feature h3 {
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 5px;
}

.block-feature-list .feature p {
  font-size: 14px;
  line-height: 1.6;
}

/* Gallery Block */
.block-gallery {
  padding: 40px;
}

.block-gallery h1 {
  font-size: 28px;
  text-align: center;
  margin-bottom: 30px;
}

.block-gallery .gallery-grid {
  display: grid;
  grid-template-columns: 1fr 0.5fr 0.5fr;
  gap: 10px;
  max-width: 1200px;
  margin: 0 auto;
}

.block-gallery .gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  cursor: pointer;
}

.block-gallery .gallery-item:first-child {
  grid-row: span 2;
}

.block-gallery .gallery-item a {
  display: block;
  width: 100%;
  height: 100%;
  padding-bottom: 100%;
  position: relative;
  overflow: hidden;
}

.block-gallery .gallery-item:first-child a {
  padding-bottom: 100%;
}

.block-gallery .gallery-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.block-gallery .gallery-item:hover img {
  transform: scale(1.05);
}

/* Divider Block */
.block-divider {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

.block-divider .line {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.block-divider .double-line {
  height: 6px;
  border-top: 2px solid rgba(0, 0, 0, 0.1);
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

/* Footer */
.footer {
  background: var(--background-color);
  padding: 60px 40px 20px;
  margin-top: 60px;
}

.footer-container {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.footer-column h2 {
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  font-size: 17px;
  letter-spacing: 0.14em;
  margin-bottom: 15px;
}

.footer-column p {
  font-size: 12px;
  letter-spacing: 0.1em;
  margin-bottom: 5px;
}

.footer-column a:hover {
  color: var(--primary-color-hover);
}

.copyright {
  text-align: center;
  padding: 30px 0 10px;
  margin-top: 40px;
  background: #2d2d2d;
  margin-left: -40px;
  margin-right: -40px;
  margin-bottom: -20px;
}

.copyright p {
  font-size: 13px;
  color: var(--secondary-color);
}

.copyright a {
  color: var(--secondary-color);
}

/* Responsive */
@media (max-width: 992px) {
  .block-three-column {
    grid-template-columns: 1fr;
  }

  .block-three-column .column {
    min-height: 300px;
  }

  .block-gallery .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }

  .block-gallery .gallery-item:first-child {
    grid-row: span 1;
    grid-column: span 2;
  }

  /* Navbar: hamburger menu on tablets and below */
  .navbar-container {
    height: 70px;
  }

  .logo {
    width: 45px;
    height: 45px;
  }

  .navbar-menu {
    display: flex;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--background-color);
    flex-direction: column;
    padding: 0 20px;
    gap: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
  }

  .navbar-menu.open {
    max-height: 500px;
    opacity: 1;
    padding: 20px;
  }

  .nav-link {
    padding: 15px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  .nav-dropdown {
    position: static;
  }

  .nav-dropdown-menu {
    position: static;
    transform: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    display: none;
    background: rgba(0, 0, 0, 0.02);
  }

  .nav-dropdown.open .nav-dropdown-menu {
    display: block;
  }

  .nav-dropdown-item {
    padding: 12px 10px 12px 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 13px;
  }

  .navbar-toggler {
    display: flex;
    position: absolute;
    right: 20px;
  }

  .navbar-spacer {
    height: 70px;
  }
}

@media (max-width: 768px) {
  .container + .container,
  .container + .block-centered-text,
  .container + .block-feature-list,
  .container + .block-gallery,
  .block-centered-text + .container,
  .block-feature-list + .container,
  .block-gallery + .container,
  .block-hero + .container,
  .block-hero + .block-centered-text,
  .block-hero + .block-feature-list,
  .block-hero + .block-gallery {
    margin-top: 40px;
  }

  .block-hero {
    height: 500px;
  }

  .block-hero .full-logo {
    width: 220px;
    height: 75px;
    margin-bottom: 15px;
  }

  .block-hero .content p {
    font-size: 14px;
  }

  .block-two-column {
    grid-template-columns: 1fr;
  }

  .block-two-column .image-column {
    min-height: 300px;
    order: -1;
  }

  .block-two-column .text-column {
    padding: 40px 20px;
  }

  .block-two-column .text-column h1 {
    font-size: 24px;
  }

  .block-centered-text {
    padding: 40px 20px;
  }

  .block-centered-text h1 {
    font-size: 24px;
  }

  .block-feature-list {
    padding: 40px 20px;
  }

  .block-feature-list h1 {
    font-size: 24px;
  }

  .block-gallery {
    padding: 20px;
  }

  .block-gallery h1 {
    font-size: 24px;
  }

  .block-gallery .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }

  .block-gallery .gallery-item:first-child {
    grid-column: span 2;
  }

  .block-three-column .column.image-column .overlay-box {
    padding: 30px 15px;
  }

  .block-three-column .column.image-column .overlay-box h1 {
    font-size: 24px;
  }

  .block-three-column .column.text-column {
    padding: 30px 20px;
  }

  .block-three-column .column.text-column h1 {
    font-size: 20px;
  }

  .block-three-column .column.text-column h2 {
    font-size: 18px;
  }

  .block-divider {
    padding: 0 20px;
  }

  .footer {
    padding: 40px 20px 20px;
  }

  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 30px;
  }

  .copyright {
    margin-left: -20px;
    margin-right: -20px;
  }

  .container {
    padding: 0 20px;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  .block-hero {
    height: 280px;
  }

  .block-hero .full-logo {
    width: 180px;
    height: 60px;
    margin-bottom: 10px;
  }

  .block-hero .content p {
    font-size: 12px;
    letter-spacing: 0.05em;
  }

  .container + .container,
  .container + .block-centered-text,
  .container + .block-feature-list,
  .container + .block-gallery,
  .block-centered-text + .container,
  .block-feature-list + .container,
  .block-gallery + .container,
  .block-hero + .container,
  .block-hero + .block-centered-text,
  .block-hero + .block-feature-list,
  .block-hero + .block-gallery {
    margin-top: 24px;
  }

  .block-hero + .container {
    padding-top: 30px;
  }

  .container {
    padding: 0 16px;
  }

  .block-two-column .image-column {
    min-height: 220px;
  }

  .block-two-column .text-column {
    padding: 30px 16px;
  }

  .block-two-column .text-column h1 {
    font-size: 22px;
  }

  .block-two-column .text-column h2 {
    font-size: 14px;
    margin-bottom: 20px;
  }

  .block-centered-text {
    padding: 30px 16px;
  }

  .block-centered-text h1 {
    font-size: 22px;
  }

  .block-feature-list {
    padding: 30px 16px;
  }

  .block-gallery {
    padding: 16px;
  }

  .block-gallery .gallery-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .block-gallery .gallery-item:first-child {
    grid-column: span 1;
  }

  .block-three-column .column {
    min-height: 250px;
  }

  .block-three-column .column.text-column p {
    font-size: 14px;
  }

  .block-divider {
    padding: 0 16px;
  }

  .footer {
    padding: 30px 16px 16px;
    margin-top: 40px;
  }

  .footer-container {
    gap: 24px;
  }

  .copyright {
    margin-left: -16px;
    margin-right: -16px;
    margin-bottom: -16px;
  }

  .nav-link {
    font-size: 14px;
  }

  #lightbox .lightbox-content img {
    max-width: 95vw;
    max-height: 80vh;
  }

  #lightbox .lightbox-close {
    top: 10px;
    right: 10px;
    font-size: 30px;
  }
}

/* Lightbox */
#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lightbox .lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  cursor: pointer;
}

#lightbox .lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
}

#lightbox .lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

#lightbox .lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  background: none;
  border: none;
  color: white;
  font-size: 40px;
  cursor: pointer;
  padding: 10px;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}

#lightbox .lightbox-close:hover {
  opacity: 1;
}

#lightbox .lightbox-prev,
#lightbox .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 30px;
  cursor: pointer;
  padding: 20px 15px;
  opacity: 0.8;
  transition: opacity 0.2s, background 0.2s;
  border-radius: 4px;
}

#lightbox .lightbox-prev:hover,
#lightbox .lightbox-next:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
}

#lightbox .lightbox-prev {
  left: 20px;
}

#lightbox .lightbox-next {
  right: 20px;
}

#lightbox .lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 14px;
  opacity: 0.8;
}

@media (max-width: 768px) {
  #lightbox .lightbox-prev,
  #lightbox .lightbox-next {
    padding: 15px 10px;
    font-size: 24px;
  }

  #lightbox .lightbox-prev {
    left: 10px;
  }

  #lightbox .lightbox-next {
    right: 10px;
  }

  #lightbox .lightbox-close {
    top: 12px;
    right: 12px;
    font-size: 32px;
  }

  #lightbox .lightbox-content img {
    max-width: 95vw;
    max-height: 85vh;
  }
}
