:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --text: #20242b;
  --muted: #5f6773;
  --accent: #6e4d2f;
  --line: #d9d3c7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background-color: var(--bg);
  background-image: var(--site-bg-image, url("/assets/images/background/lonesome-ranch-background.jpeg"));
  background-repeat: repeat;
  background-size: auto;
  color: var(--text);
  line-height: 1.55;
}

a { color: var(--accent); }
a:hover { text-decoration: none; }

.site-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 18px 48px;
}

.site-header {
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
  padding-bottom: 12px;
}

.site-title {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.site-title-link,
.site-title-link:visited,
.site-title-link:hover,
.site-title-link:active,
.site-title-link:focus {
  text-decoration: none;
  color: #fff;
}

.site-tagline {
  margin: 6px 0 0;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  font-size: 0.95rem;
}

.site-nav {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-nav a {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  background: #fffdf9;
}

.site-nav a.current {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.site-nav a:focus-visible,
.home-audio-controls button:focus-visible,
.hero-nav:focus-visible,
.hero-dot:focus-visible,
.audio-unlock-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.05);
}

h1 {
  margin: 0 0 14px;
  font-size: 2rem;
}

.content > *:first-child { margin-top: 0; }
.content > *:last-child { margin-bottom: 0; }

figure {
  margin: 0 0 16px;
}

.js-carousel-item {
  position: relative;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  margin-bottom: 18px;
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
}

.home-audio-controls {
  margin-top: 10px;
}

.home-audio-controls button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}

.hero-carousel {
  position: relative;
  margin: 0 0 18px;
  overflow: hidden;
  border-radius: 12px;
}

.hero-carousel-track {
  position: relative;
  min-height: 260px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .45s ease;
  pointer-events: none;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
}

.hero-slide figure {
  position: relative;
  margin: 0;
}

.carousel-photo-index {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  min-width: 2.1rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}

.hero-slide img {
  width: 100%;
  max-height: 65vh;
  object-fit: cover;
  display: block;
}

.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.45);
  border: 0;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  cursor: pointer;
}

.hero-nav.prev { left: 10px; }
.hero-nav.next { right: 10px; }

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 0;
  cursor: pointer;
  padding: 0;
}

.hero-dot.is-active {
  background: #fff;
}

.site-footer {
  margin-top: 26px;
  color: var(--muted);
  font-size: 0.9rem;
}

.audio-unlock-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.audio-unlock-card {
  width: 100%;
  max-width: 420px;
  border-radius: 14px;
  padding: 20px 18px;
  background: rgba(17, 20, 24, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.25);
  text-align: center;
  color: #fff;
}

.audio-spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 10px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: audio-spin 0.85s linear infinite;
}

.audio-unlock-button {
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: #fff;
  color: #1e1e1e;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.95rem;
}

.form-status,
.form-error {
  border-radius: 10px;
  padding: 10px 12px;
  margin: 10px 0 12px;
}

.form-status {
  color: #175f28;
  border: 1px solid #b9debe;
  background: #ecf8ef;
}

.form-error {
  color: #8f1d1d;
  border: 1px solid #e8b5b5;
  background: #fff1f1;
}

.contact-form p {
  margin: 0 0 14px;
}

.contact-form label {
  display: inline-block;
  font-weight: 600;
  margin-bottom: 5px;
}

.required-mark {
  color: #b00020;
}

.required-note {
  color: #b00020;
  font-size: 0.95rem;
}

.contact-form input {
  width: 100%;
  max-width: 460px;
  border: 1px solid #c7c4bd;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

.contact-form input:focus {
  outline: 2px solid rgba(110, 77, 47, 0.25);
  border-color: var(--accent);
}

.button-primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  font: inherit;
}

.button-primary:hover {
  filter: brightness(1.04);
}

.button-primary:focus {
  outline: 2px solid rgba(110, 77, 47, 0.3);
  outline-offset: 1px;
}

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

@media (max-width: 820px) {
  .site-wrap {
    padding: 14px 14px 36px;
  }

  .site-title {
    font-size: 1.75rem;
  }

  h1 {
    font-size: 1.72rem;
  }

  .card {
    padding: 16px;
  }

  .site-nav {
    gap: 8px;
  }

  .site-nav a {
    padding: 7px 11px;
    font-size: 0.95rem;
  }

  .hero-slide img {
    max-height: 56vh;
  }
}

@media (max-width: 560px) {
  .site-wrap {
    padding: 12px 10px 28px;
  }

  .site-title {
    font-size: 1.45rem;
  }

  .site-tagline {
    font-size: 0.88rem;
  }

  h1 {
    font-size: 1.45rem;
    margin-bottom: 10px;
  }

  .card {
    padding: 13px;
    border-radius: 12px;
  }

  .site-nav {
    gap: 7px;
  }

  .site-nav a {
    padding: 7px 10px;
    font-size: 0.9rem;
  }

  .hero-carousel-track {
    min-height: 190px;
  }

  .hero-slide img {
    max-height: 47vh;
  }

  .hero-nav {
    width: 34px;
    height: 34px;
  }

  .contact-form input {
    max-width: none;
  }

  .button-primary {
    width: 100%;
    max-width: 220px;
  }
}
