/* urlaub.bg – Verfügbarkeitskalender + Datums-Picker.
   Halbtags-Diagonale wie im internen Bereich (calendar.js buildCell):
   linear-gradient(to bottom right, amFarbe 0 48%, #fff 48% 52%, pmFarbe 52% 100%) */

.cal-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 18px 18px 14px;
}

/* Ansicht-Umschalter */
.cal-tabs {
  display: flex;
  /* Sicherheitsnetz: lieber in eine zweite Zeile umbrechen als aus der Pille
     herauslaufen. Ohne das zog eine zu lange Beschriftung (die Sprachen sind
     unterschiedlich wortreich) die gesamte Seite in die Horizontale. */
  flex-wrap: wrap;
  gap: 6px;
  background: var(--sand-100);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 14px;
  width: max-content;
  max-width: 100%;
}
.cal-tabs button {
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  font-size: .9rem;
  color: var(--ink-soft);
  padding: .45em 1em;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.cal-tabs button.active { background: var(--sea-800); color: #fff; }

/* Schmale Displays: die Register teilen sich die volle Breite der Karte. */
@media (max-width: 560px) {
  .cal-tabs { width: 100%; }
  .cal-tabs button {
    flex: 1 1 auto;
    padding: .45em .5em;
    font-size: .82rem;
    text-align: center;
  }
}
/* Sehr schmale Geraete (320 px): nur so viel enger, dass auch die laengsten
   Beschriftungen ("Apartment A/F") noch in eine Zeile passen. */
@media (max-width: 340px) {
  .cal-tabs button { padding: .45em .35em; font-size: .78rem; }
}

/* Monats-Slider */
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav .cal-arrow {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--sea-100);
  background: #fff;
  color: var(--sea-800);
  font-size: 1.1rem;
  cursor: pointer;
}
.cal-nav .cal-arrow:hover { background: var(--sea-100); }
.cal-nav .cal-arrow:disabled { opacity: .35; cursor: default; }

.cal-months {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  flex: 1;
  padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cal-months::-webkit-scrollbar { display: none; }

.cal-month {
  flex: 0 0 100%;
  scroll-snap-align: start;
  min-width: 0;
}
@media (min-width: 720px)  { .cal-month { flex-basis: calc(50% - 9px); } }
@media (min-width: 1050px) { .cal-month { flex-basis: calc(33.334% - 12px); } }

.cal-month h3 {
  margin: 0 0 8px;
  text-align: center;
  color: var(--sea-800);
  font-size: 1rem;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-grid .dow {
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  color: var(--ink-soft);
  padding-bottom: 2px;
}

/* Tageszellen */
.cal-cell {
  position: relative;
  aspect-ratio: 1 / .92;
  border-radius: 7px;
  font-size: .82rem;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 2px 4px 0 0;
  color: var(--ink);
  background: var(--cal-free);
  border: 0;
  font-family: inherit;
  cursor: default;
  user-select: none;
}
.cal-cell.empty { background: transparent; }
.cal-cell.past { background: #eef1f3; color: #b3bfc7; }
.cal-cell.pickable { cursor: pointer; }
.cal-cell.pickable:hover { outline: 2px solid var(--sea-700); outline-offset: -1px; z-index: 1; }
.cal-cell .daynum { pointer-events: none; }

/* Auswahl (Anreise/Abreise/Zeitraum) */
.cal-cell.sel-range { box-shadow: inset 0 0 0 3px var(--sea-700); }
.cal-cell.sel-arrival, .cal-cell.sel-departure { box-shadow: inset 0 0 0 3px var(--sea-800); }
.cal-cell.sel-arrival::after, .cal-cell.sel-departure::after {
  content: '';
  position: absolute;
  left: 4px; bottom: 4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--sea-800);
}

/* Legende */
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 10px;
  font-size: .85rem;
  color: var(--ink-soft);
}
.cal-legend .key { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend .swatch {
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(9, 43, 62, .15);
  display: inline-block;
}

/* Hinweiszeile unter dem Kalender */
.cal-hint {
  margin-top: 10px;
  font-size: .95rem;
  font-weight: 700;
  color: var(--sea-700);
  min-height: 1.5em;
}
.cal-hint.warn { color: #b03a2e; }

.cal-error {
  background: #fdecea;
  color: #b03a2e;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: .95rem;
}

/* Kompakter Einzel-Kalender auf den Wohnungsseiten */
.cal-card.single .cal-tabs { display: none; }
/* schmale Aside-Spalte: immer nur 1 Monat je Ansicht, egal wie breit der Viewport ist */
.cal-card.single .cal-month { flex-basis: 100%; }
