/* Shared availability calendar for The Homemead.
   Used on av.html and contact.html. Inherits the site's green palette. */

.hc {
  --hc-green: var(--primary-color, #2a6d45);
  --hc-green-dark: var(--primary-dark, #1f4f33);
  --hc-green-light: var(--primary-light, #e6f0ea);
  --hc-line: #e4e4e4;
  --hc-muted: #9a9a9a;
  --hc-faint: #c9c9c9;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
}

.hc *, .hc *::before, .hc *::after { box-sizing: border-box; }

/* ── Header: nights count and the two date fields ── */

.hc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.hc-nights {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: #222;
  margin: 0;
}

.hc-range {
  font-size: 1rem;
  color: var(--hc-muted);
  margin: 4px 0 0;
}

.hc-fields {
  display: flex;
  border: 1px solid var(--hc-line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.hc-field {
  position: relative;
  padding: 12px 44px 12px 18px;
  min-width: 168px;
  border-right: 1px solid var(--hc-line);
}

.hc-field:last-child { border-right: none; }

.hc-field.is-active {
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px #222;
}

.hc-field label {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #444;
  margin-bottom: 2px;
}

.hc-value { font-size: 1rem; color: #222; }
.hc-value.is-empty { color: var(--hc-faint); }

.hc-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: #555;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 50%;
}

.hc-clear:hover { background: #f0f0f0; }

/* ── Months ── */

.hc-months {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 52px;
}

.hc-arrow {
  position: absolute;
  top: -6px;
  left: 0;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  color: #444;
  cursor: pointer;
  transition: background 0.15s;
}

.hc-arrow:hover:not(:disabled) { background: #f0f0f0; }
.hc-arrow:disabled { color: var(--hc-faint); cursor: default; }
.hc-next { left: auto; right: 0; }

.hc-month-name {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 20px;
}

.hc-weekdays, .hc-days { display: grid; grid-template-columns: repeat(7, 1fr); }

.hc-weekdays div {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 400;
  color: #555;
  padding-bottom: 12px;
}

.hc-day {
  position: relative;
  aspect-ratio: 1 / 0.92;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  color: #222;
  cursor: pointer;
  padding: 0;
}

.hc-day .hc-num {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}

.hc-day:hover:not(:disabled) .hc-num { box-shadow: inset 0 0 0 1px #222; }

.hc-day.is-blank { visibility: hidden; cursor: default; }

.hc-day.is-static { cursor: default; }
.hc-day.is-static:hover .hc-num { box-shadow: none; }

/* Unavailable: struck through, same as the reference design. */
.hc-day:disabled {
  cursor: default;
  color: var(--hc-faint);
  font-weight: 400;
}
.hc-day:disabled .hc-num { text-decoration: line-through; }

/* Nights between the two chosen dates. */
.hc-day.in-range { background: var(--hc-green-light); }
.hc-day.range-start { border-radius: 999px 0 0 999px; }
.hc-day.range-end { border-radius: 0 999px 999px 0; }
.hc-day.range-start.range-end { border-radius: 999px; }

.hc-day.is-end .hc-num {
  background: var(--hc-green);
  color: #fff;
}

.hc-day.is-pending .hc-num {
  box-shadow: inset 0 0 0 2px var(--hc-green);
}

/* ── Footer ── */

.hc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--hc-line);
}

.hc-legend {
  display: flex;
  gap: 22px;
  font-size: 0.88rem;
  color: var(--hc-muted);
}

.hc-legend span { display: flex; align-items: center; gap: 8px; }

.hc-swatch {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid var(--hc-line);
  display: inline-block;
}

.hc-swatch--free { background: #fff; }
.hc-swatch--taken { background: #e8e8e8; border-color: #dcdcdc; }

.hc-note {
  font-size: 0.92rem;
  color: var(--hc-green-dark);
  background: var(--hc-green-light);
  padding: 9px 14px;
  border-radius: 8px;
}

.hc-note.is-warning { background: #fdf3e3; color: #8a5a12; }

.hc-loading, .hc-error {
  text-align: center;
  padding: 40px 20px;
  color: var(--hc-muted);
  font-size: 0.95rem;
}

.hc-error { color: #b03b3b; }

/* ── Responsive ── */

@media (max-width: 820px) {
  .hc-months { grid-template-columns: 1fr; gap: 36px; }
  .hc-month:nth-of-type(2) { display: none; }
}

@media (max-width: 560px) {
  .hc-nights { font-size: 1.4rem; }
  .hc-fields { width: 100%; }
  .hc-field { flex: 1; min-width: 0; padding: 10px 36px 10px 14px; }
  .hc-day .hc-num { width: 34px; height: 34px; }
  .hc-legend { gap: 14px; font-size: 0.82rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hc * { transition: none !important; }
}
