/* ===========================================================================
   Interactive availability calendar — styles

   Pairs with web/availability-calendar.js.

   Every custom property carries a fallback, so this drops into any site
   whether or not it defines the same tokens. To rebrand, define these on
   :root in your own stylesheet rather than editing this file:

     --white --sand --sand-light --emerald --emerald-deep --emerald-light
     --seafoam --seafoam-light --text --text-light --radius --radius-sm
     --radius-pill

   The booked / holiday colours are literal rather than tokenised on purpose:
   they must stay legible against whatever the brand palette is, and they need
   to read as "unavailable" rather than as a brand accent.
   =========================================================================== */

.ac {
  background: var(--white, #ffffff);
  border: 1px solid rgba(13, 74, 61, 0.10);
  border-radius: var(--radius, 16px);
  padding: 1.25rem;
}

.ac-loading,
.ac-failed {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light, #6b6b6b);
}

/* --- header: month title doubles as the month/year picker trigger -------- */

.ac-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.ac-title {
  font-family: var(--font-display, 'Cormorant Garamond'), Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--emerald-deep, #0d4a3d);
  border: 0;
  background: none;
  cursor: pointer;
  padding: 2px 10px;
  border-radius: 6px;
}
.ac-title:hover { background: var(--seafoam-light, #d4ede3); }

.ac-nav {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(13, 74, 61, 0.2);
  border-radius: var(--radius-pill, 100px);
  background: var(--white, #ffffff);
  color: var(--emerald, #1a6b5a);
  font-size: 1.1rem;
  cursor: pointer;
}
.ac-nav:hover:not(:disabled) {
  background: var(--emerald, #1a6b5a);
  border-color: var(--emerald, #1a6b5a);
  color: var(--white, #ffffff);
}
.ac-nav:disabled { opacity: 0.3; cursor: not-allowed; }

.ac-pick { display: flex; gap: 6px; }
.ac-pick-m,
.ac-pick-y,
.ac-pick select {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 6px 8px;
  border: 1px solid rgba(13, 74, 61, 0.2);
  border-radius: 6px;
  background: var(--white, #ffffff);
  color: var(--emerald-deep, #0d4a3d);
  cursor: pointer;
}

/* --- grid ---------------------------------------------------------------- */

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

.ac-dow {
  text-align: center;
  padding: 0.3rem 0 0.5rem;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-light, #6b6b6b);
}

.ac-pad { aspect-ratio: 1; }

.ac-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(13, 74, 61, 0.10);
  border-radius: 7px;
  background: var(--white, #ffffff);
  color: var(--text, #2c2c2c);
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s, border-color 0.12s;
}
.ac-day:hover:not(:disabled) {
  border-color: var(--emerald, #1a6b5a);
  background: var(--seafoam-light, #d4ede3);
}

/* the date, and the nightly rate beneath it */
.ac-n { font-size: 0.85rem; font-weight: 500; line-height: 1.05; }
.ac-r { font-size: 0.6rem; font-weight: 500; color: var(--emerald, #1a6b5a); line-height: 1.05; }

/* --- day states ---------------------------------------------------------- */
/* Past and out-of-window share a treatment: both mean "not offerable", and
   they are visually distinct from booked, which means "taken". */

.ac-day.is-past {
  opacity: 0.35;
  cursor: not-allowed;
  background: var(--sand-light, #faf8f3);
}
.ac-day.is-past .ac-r { display: none; }

.ac-day.is-blocked {
  background: #cfc6b6;
  border-color: #bcb2a0;
  color: #6b6357;
  cursor: not-allowed;
  text-decoration: line-through;
}
.ac-day.is-blocked .ac-r { color: #8a8175; }

.ac-day.is-today { box-shadow: inset 0 0 0 1px var(--emerald, #1a6b5a); }

.ac-day.is-arrival,
.ac-day.is-departure {
  background: var(--emerald, #1a6b5a);
  border-color: var(--emerald, #1a6b5a);
  color: var(--white, #ffffff);
  font-weight: 600;
}
.ac-day.is-arrival .ac-r,
.ac-day.is-departure .ac-r { color: rgba(255, 255, 255, 0.9); }

.ac-day.is-between {
  background: var(--seafoam-light, #d4ede3);
  border-color: var(--seafoam, #a8d5c2);
}

/* --- footer -------------------------------------------------------------- */

.ac-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(13, 74, 61, 0.10);
  font-size: 0.8rem;
  color: var(--text-light, #6b6b6b);
  flex-wrap: wrap;
}
.ac-foot strong { color: var(--emerald-deep, #0d4a3d); }

/* the selection summary, and the prompt shown before anything is chosen */
.ac-sel,
.ac-hint { flex: 1 1 auto; min-width: 0; }
.ac-hint { color: var(--text-light, #6b6b6b); }

.ac-share {
  border: 1px solid rgba(13, 74, 61, 0.2);
  background: var(--white, #ffffff);
  color: var(--emerald, #1a6b5a);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill, 100px);
  margin-right: 0.5rem;
}
.ac-share:hover {
  background: var(--emerald, #1a6b5a);
  border-color: var(--emerald, #1a6b5a);
  color: var(--white, #ffffff);
}

.ac-clear {
  border: 0;
  background: none;
  color: var(--emerald, #1a6b5a);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  text-decoration: underline;
  padding: 0;
}

.ac-legend {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.7rem;
  font-size: 0.7rem;
  color: var(--text-light, #6b6b6b);
  flex-wrap: wrap;
}
.ac-k {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  margin-left: 0.6rem;
}
.ac-k:first-child { margin-left: 0; }
.ac-k-open { background: var(--white, #ffffff); border: 1px solid rgba(13, 74, 61, 0.2); }
.ac-k-blocked { background: #cfc6b6; border: 1px solid #bcb2a0; }
.ac-k-sel { background: var(--emerald, #1a6b5a); }

/* --- narrow -------------------------------------------------------------- */

@media (max-width: 480px) {
  .ac { padding: 0.9rem; }
  .ac-title { font-size: 1.2rem; }
  .ac-n { font-size: 0.8rem; }
  .ac-r { font-size: 0.55rem; }
  .ac-grid { gap: 2px; }
}
