/* ---------- Palette ---------- */
:root {
  --color-cream: #fbf6ec;
  --color-sand: #efe3cc;
  --color-shell: #fffdf7;
  --color-espresso: #2a2520;
  --color-stone: #7a7160;
  --color-olive: #6e5f26;
  --color-olive-700: #5a4d1f;
  --color-gold: #c7a24b;
  --color-sea: #245e63;
  --color-rose: #b5654e;
  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-body: "Manrope", ui-sans-serif, system-ui, sans-serif;
}

html { scroll-padding-top: 6rem; }
#main:focus { outline: none; }

/* ---------- Base typography ---------- */
body {
  font-family: var(--font-body, "Manrope", system-ui, sans-serif);
  color: var(--color-espresso, #2a2520);
  background-color: var(--color-cream, #fbf6ec);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display, "Fraunces", Georgia, serif);
  font-optical-sizing: auto;
  letter-spacing: -0.015em;
  line-height: 1.05;
}

/* Eyebrow - small spaced label above a heading */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

/* Thin decorative divider (horizon) */
.horizon {
  height: 1px;
  width: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--color-gold) 70%, transparent) 20%,
    var(--color-gold) 50%,
    color-mix(in srgb, var(--color-gold) 70%, transparent) 80%,
    transparent
  );
}

/* ---------- Glassmorphism ---------- */
.glass {
  background: color-mix(in srgb, var(--color-shell) 78%, transparent);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

/* ---------- Grain texture ---------- */
.grain {
  position: relative;
  isolation: isolate;
}
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}

/* ---------- Header (sticky + condense) ---------- */
#site-header {
  transition: padding 0.35s ease, background-color 0.35s ease,
    box-shadow 0.35s ease, border-color 0.35s ease;
}
#site-header.scrolled {
  background: color-mix(in srgb, var(--color-cream) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 8px 30px -18px rgba(42, 37, 32, 0.45);
  border-color: color-mix(in srgb, var(--color-olive) 14%, transparent);
}

/* Nav link with center-out underline */
.nav-link {
  position: relative;
  padding-bottom: 2px;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 2px;
  width: 100%;
  background: var(--color-sea);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}
.nav-link[aria-current="page"] {
  color: var(--color-sea);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-weight: 600;
  border-radius: 999px;
  transition: transform 0.25s ease, box-shadow 0.25s ease,
    background-color 0.25s ease, color 0.25s ease;
  will-change: transform;
}
.btn:active {
  transform: translateY(1px) scale(0.99);
}

/* Primary button - olive→gold gradient with sheen */
.btn-primary {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, var(--color-olive), var(--color-olive-700));
  box-shadow: 0 10px 26px -12px rgba(110, 95, 38, 0.85);
}
.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 20%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 80%
  );
  transform: translateX(-120%);
  transition: transform 0.7s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -12px rgba(110, 95, 38, 0.9);
}
.btn-primary:hover::before {
  transform: translateX(120%);
}

.btn-ghost {
  border: 1.5px solid color-mix(in srgb, var(--color-espresso) 22%, transparent);
  color: var(--color-espresso);
  background: transparent;
}
.btn-ghost:hover {
  border-color: var(--color-sea);
  color: var(--color-sea);
  transform: translateY(-2px);
}

/* ---------- Cards ---------- */
.card {
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.4s ease;
  will-change: transform;
}
.card:hover {
  transform: translateY(-6px);
}
/* Image zoom on hover */
.media-zoom {
  overflow: hidden;
}
.media-zoom img {
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.card:hover .media-zoom img,
.media-zoom:hover img {
  transform: scale(1.06);
}

/* Chip / amenity pill */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-sea) 9%, var(--color-shell));
  border: 1px solid color-mix(in srgb, var(--color-sea) 16%, transparent);
}

/* ---------- Scroll-reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Subtle floating accent */
.float-slow {
  animation: floatSlow 7s ease-in-out infinite;
}
@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ---------- Gallery / lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(20, 17, 14, 0.86);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.lightbox.open {
  display: flex;
  opacity: 1;
}
/* ---------- Lightbox inner layout ---------- */
.lb-inner {
  display: flex;
  flex-direction: column;
  width: min(1200px, 96vw);
  height: 100%;
  gap: 0.75rem;
}
.lb-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-height: 2.25rem;
  padding-right: 3.5rem; /* room for the × button */
  color: color-mix(in srgb, var(--color-cream) 88%, transparent);
}
.lb-counter {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.lb-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}
/* Absolute + margin:auto centering: max-height:100% resolves against the
   stage height, so the image never overflows onto the thumbnail strip. */
.lb-stage img {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.9rem;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
}
.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-shell) 88%, transparent);
  color: var(--color-espresso);
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s ease, background 0.2s ease;
  z-index: 2;
}
.lb-arrow:hover { transform: translateY(-50%) scale(1.08); }
.lb-prev { left: 0.25rem; }
.lb-next { right: 0.25rem; }
.lb-strip {
  flex: 0 0 auto;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.lb-strip::-webkit-scrollbar { display: none; }
.lb-thumb {
  flex: 0 0 auto;
  width: 76px;
  height: 56px;
  border-radius: 0.55rem;
  overflow: hidden;
  opacity: 0.5;
  cursor: pointer;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  transition: opacity 0.2s ease, border-color 0.2s ease;
}
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-thumb:hover { opacity: 0.85; }
.lb-thumb.active { opacity: 1; border-color: var(--color-gold); }

/* "+N photos" overlay on the last visible thumbnail */
.more-badge {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--color-espresso) 52%, transparent);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  pointer-events: none;
}

@media (max-width: 640px) {
  .lb-arrow { width: 2.5rem; height: 2.5rem; }
  .lb-thumb { width: 60px; height: 46px; }
}

/* ---------- Mobile quick-contact bar ---------- */
.quickbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: color-mix(in srgb, var(--color-olive) 18%, transparent);
  box-shadow: 0 -10px 30px -16px rgba(42, 37, 32, 0.5);
  transform: translateY(110%);
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.quickbar.show {
  transform: translateY(0);
}
@media (min-width: 768px) {
  .quickbar { display: none !important; }
}
/* Hide the bar when menu or lightbox is open */
body.no-scroll .quickbar { transform: translateY(110%) !important; }
/* Reserve footer bottom space so the quickbar doesn't cover it (mobile) */
@media (max-width: 767px) {
  footer { padding-bottom: 4.5rem; }
}

/* Lightbox close button */
.lb-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-shell) 92%, transparent);
  color: var(--color-espresso);
  font-size: 1.7rem;
  line-height: 1;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.6);
  transition: transform 0.25s ease;
}
.lb-close:hover { transform: scale(1.06); }

/* ---------- Form ---------- */
.field {
  width: 100%;
  border-radius: 0.9rem;
  border: 1.5px solid color-mix(in srgb, var(--color-espresso) 14%, transparent);
  background: var(--color-shell);
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  color: var(--color-espresso);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.field::placeholder { color: color-mix(in srgb, var(--color-stone) 80%, transparent); }
.field:focus {
  outline: none;
  border-color: var(--color-sea);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-sea) 14%, transparent);
}
.field.invalid {
  border-color: var(--color-rose);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-rose) 14%, transparent);
}
.field-error {
  display: none;
  color: var(--color-rose);
  font-size: 0.8rem;
  margin-top: 0.35rem;
}
.field-error.show { display: block; }

/* ---------- A11y: focus + reduced motion ---------- */
:focus-visible {
  outline: 2.5px solid var(--color-sea);
  outline-offset: 3px;
  border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* Lock scroll when menu / lightbox is open */
body.no-scroll { overflow: hidden; }

/* ---------- Mobile menu ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  /* Below the header (z-50) so the close (X) stays clickable */
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 6rem 1.75rem 2rem;
  background: color-mix(in srgb, var(--color-cream) 96%, transparent);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
}
.mobile-menu.open {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.mobile-menu a.m-link {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 0.55rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--color-olive) 12%, transparent);
}

/* ---------- Skip link (a11y) ---------- */
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 50%;
  transform: translate(-50%, -150%);
  z-index: 100;
  background: var(--color-espresso);
  color: #fff;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform 0.25s ease;
}
.skip-link:focus {
  transform: translate(-50%, 0);
}

/* Hamburger → X icon */
.burger { position: relative; }
.burger span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 2px;
  margin-left: -11px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.burger span:nth-child(1) { transform: translateY(-6px); }
.burger span:nth-child(2) { transform: translateY(0); }
.burger span:nth-child(3) { transform: translateY(6px); }
.burger[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg); }

/* Text selection color */
::selection {
  background: color-mix(in srgb, var(--color-gold) 40%, transparent);
}
