:root {
  --navy: #1b3a4b;
  --sand: #f6f1e9;
  --terracotta: #c8703d;
  --terracotta-dark: #a85a2c;
  --text: #2b2b2b;
  --muted: #6b6b6b;
  --border: #e2ddd2;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--sand);
  line-height: 1.5;
}

a { color: var(--terracotta-dark); }

header.site-header {
  background: var(--navy);
  color: #fff;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

header.site-header a { color: #fff; text-decoration: none; }

.site-title { font-size: 22px; font-weight: 700; }

nav.site-nav a {
  margin-left: 20px;
  font-size: 15px;
}

main { max-width: 1000px; margin: 0 auto; padding: 32px 20px 60px; }

.hero {
  text-align: center;
  padding: 40px 20px 20px;
}

.hero h1 { font-size: 32px; margin-bottom: 8px; }
.hero p { color: var(--muted); font-size: 17px; }

.property-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 32px;
}

@media (max-width: 700px) {
  .property-grid { grid-template-columns: 1fr; }
}

.property-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.property-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }

.photo-placeholder {
  height: 200px;
  background: linear-gradient(135deg, var(--navy), var(--terracotta));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.photo-cover {
  height: 200px;
  width: 100%;
  display: block;
  object-fit: cover;
  border-radius: var(--radius);
}

.property-gallery {
  margin-bottom: 24px;
}

.gallery-hero {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
  margin-bottom: 12px;
}

.gallery-thumbs {
  display: flex;
  gap: 12px;
}

.gallery-thumbs img {
  flex: 1;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

@media (max-width: 500px) {
  .gallery-thumbs { flex-direction: column; }
  .gallery-thumbs img { height: 160px; }
}

/* Full photo gallery (property pages, below the booking widget) */
.full-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.full-gallery img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

@media (max-width: 700px) {
  .full-gallery { grid-template-columns: repeat(2, 1fr); }
}

.property-card .card-body { padding: 20px; }
.property-card h2 { margin: 0 0 6px; font-size: 21px; }
.property-card p { margin: 0; color: var(--muted); }

.card-cta {
  display: inline-block;
  margin-top: 14px;
  background: var(--terracotta);
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

footer.site-footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
}

/* Booking widget (used on property pages) */
.booking-widget {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 28px;
}

.booking-widget h2 { margin-top: 0; font-size: 20px; }

.booking-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.booking-field { flex: 1; min-width: 140px; }
.booking-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.booking-field input, .booking-field select {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
}

.btn-primary {
  background: var(--terracotta);
  color: #fff;
  border: none;
  padding: 11px 22px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { background: var(--terracotta-dark); }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }

.quote-box {
  margin-top: 18px;
  padding: 16px;
  background: var(--sand);
  border-radius: 8px;
  display: none;
}
.quote-box.visible { display: block; }
.quote-line { display: flex; justify-content: space-between; padding: 3px 0; font-size: 14px; }
.quote-line.total { font-weight: 700; font-size: 16px; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }

.error-box {
  margin-top: 14px;
  padding: 12px 16px;
  background: #fdecea;
  color: #8a2a1f;
  border-radius: 8px;
  display: none;
  font-size: 14px;
}
.error-box.visible { display: block; }

.form-status {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  display: none;
  font-size: 14px;
}
.form-status.visible { display: block; }
.form-status.success { background: #eaf6ec; color: #1e5b2c; }
.form-status.error { background: #fdecea; color: #8a2a1f; }

/* Availability calendar */
.calendar-widget { margin-top: 6px; max-width: 360px; }

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 600;
}

.cal-nav-btn {
  background: var(--sand);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.cal-nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  background: #eaf6ec;
  color: #1e5b2c;
}

.cal-day.unavailable {
  background: #fdecea;
  color: #8a2a1f;
  cursor: not-allowed;
  text-decoration: line-through;
}

.cal-day.past {
  background: transparent;
  color: #c9c4b8;
  cursor: default;
}

.cal-day.blank { background: transparent; cursor: default; }

.cal-day.loading {
  background: var(--border);
  color: var(--muted);
  cursor: wait;
  animation: cal-pulse 1.1s ease-in-out infinite;
}

@keyframes cal-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.calendar-hint.calendar-hint-loading {
  color: var(--terracotta-dark);
  font-weight: 600;
}

.cal-day.selected-start,
.cal-day.selected-end {
  background: var(--terracotta);
  color: #fff;
  font-weight: 700;
}

.cal-day.in-range {
  background: #f3d9c4;
  color: var(--text);
}

.calendar-legend {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}
.legend-swatch.available { background: #eaf6ec; border: 1px solid #1e5b2c; }
.legend-swatch.unavailable { background: #fdecea; border: 1px solid #8a2a1f; }
.legend-swatch.selected { background: var(--terracotta); }

.calendar-hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  margin-bottom: 0;
}

/* Property descriptions — preserve line breaks / paragraph spacing exactly
   as Karen types them in the Sheet's Descriptions tab (Google Sheets uses
   Alt+Enter for a new line within a cell; without this, the browser
   collapses those line breaks and words run together). */
#propertyDescription {
  white-space: pre-line;
}

/* Read more / Read less — description starts collapsed to a few lines so
   the booking widget below it isn't pushed far down the page. */
#propertyDescription.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.description-toggle {
  display: none; /* JS reveals this only if the text is actually longer than 3 lines */
  background: none;
  border: none;
  padding: 0;
  margin-top: 4px;
  margin-bottom: 12px;
  color: var(--terracotta-dark);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.description-toggle:hover { color: var(--terracotta); }
