/*
 * nepali-datepicker.css
 *
 * Styling for the BS/AD picker. The structure follows
 * anuzpandey/nepali-date-picker (MIT); the colours and shapes are this
 * site's own, taken from the variables in style.css so the picker looks
 * like the rest of the booking form rather than a bolted-on widget.
 *
 * It deliberately reads like a browser's own date popup: a plain white
 * card, a month title with two arrows, a seven-column grid, and today
 * marked. What a browser cannot do, and this does, is say which days can
 * be booked.
 */

/* The real input still holds the value and is still what submits. It is
   moved out of sight rather than removed, so the form works untouched if
   the script never runs. */
.ndp-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Without the script the input is never given .ndp-native, so it simply
   stays visible and usable. */

.ndp {
  position: relative;
}

/* ---------- calendar toggle ---------- */

.ndp-toggle {
  display: inline-flex;
  padding: 2px;
  margin-bottom: .45rem;
  background: var(--mist, #f4f8f9);
  border: 1px solid var(--line, #dbe6e7);
  border-radius: 999px;
}

.ndp-toggle-btn {
  padding: .2rem .7rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-soft, #56707c);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.ndp-toggle-btn.is-active {
  color: #fff;
  background: var(--tide, #1f6b7d);
}

.ndp-toggle-btn:focus-visible {
  outline: 2px solid var(--tide, #1f6b7d);
  outline-offset: 2px;
}

/* ---------- the closed field ---------- */

.ndp-field {
  width: 100%;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink, #12303c);
  background: #fff;
}

.ndp-field.is-empty {
  font-weight: 400;
  color: var(--ink-soft, #56707c);
}

/* ---------- the popup ---------- */

.ndp-panel {
  position: absolute;
  z-index: 50;
  top: calc(100% + .35rem);
  left: 0;
  width: min(21rem, calc(100vw - 2.5rem));
  padding: .75rem;
  background: #fff;
  border: 1px solid var(--line, #dbe6e7);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(18, 48, 60, .16);
}

.ndp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .5rem;
}

.ndp-title {
  font-weight: 700;
  color: var(--ink, #12303c);
}

.ndp-nav {
  width: 30px;
  height: 30px;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--tide, #1f6b7d);
  background: transparent;
  border: 1px solid var(--line, #dbe6e7);
  border-radius: 8px;
  cursor: pointer;
}

.ndp-nav:disabled { opacity: .35; cursor: default; }
.ndp-nav:not(:disabled):hover { background: var(--mist, #f4f8f9); }

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

.ndp-weekday {
  padding: .25rem 0;
  font-size: .7rem;
  font-weight: 700;
  text-align: center;
  color: var(--ink-soft, #56707c);
}

.ndp-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink, #12303c);
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

/* Green, red, grey. Colour is never the only signal: an unavailable day
   is also disabled, and every one carries a tooltip saying why, so this
   still works for anyone who cannot distinguish the two. */
.ndp-day.is-available {
  color: #1c6b33;
  background: #e6f4ea;
  border-color: #b7e0c3;
}

.ndp-day.is-available:hover {
  border-color: #1c6b33;
}

.ndp-day.is-full {
  color: #9b2226;
  background: #fdeaea;
  border-color: #f2c2c2;
  text-decoration: line-through;
  cursor: not-allowed;
}

.ndp-day.is-closed,
.ndp-day.is-outside {
  color: #9aa7ad;
  background: transparent;
  cursor: not-allowed;
}

.ndp-day.is-open:hover { background: var(--mist, #f4f8f9); }

.ndp-day.is-selected {
  color: #fff;
  background: var(--tide, #1f6b7d);
  border-color: var(--tide-deep, #14495a);
}

.ndp-day:focus-visible {
  outline: 2px solid var(--tide, #1f6b7d);
  outline-offset: 1px;
}

.ndp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .6rem;
  padding-top: .55rem;
  border-top: 1px solid var(--line, #dbe6e7);
  font-size: .72rem;
  color: var(--ink-soft, #56707c);
}

.ndp-legend-item::before {
  content: "";
  display: inline-block;
  width: .6rem;
  height: .6rem;
  margin-right: .3rem;
  border-radius: 3px;
  vertical-align: middle;
}

.ndp-legend-item.is-available::before { background: #b7e0c3; }
.ndp-legend-item.is-full::before      { background: #f2c2c2; }
.ndp-legend-item.is-closed::before    { background: #dde3e5; }

.ndp-note {
  margin: 0;
  padding: .5rem 0;
  font-size: .85rem;
  color: var(--ink-soft, #56707c);
}

/* Fingers need bigger targets than a pointer does. */
@media (max-width: 575px) {
  .ndp-panel { width: min(20rem, calc(100vw - 2rem)); }
  .ndp-day { font-size: .9rem; }
}
