/*
 * Archiv, Einzelseite, Galerie, Lichtkasten und Kalender.
 *
 * Baut auf ghb-search.css auf - die Karten im Archiv sind dieselben wie in der
 * Suche. Wie dort gilt: Abstaende und Raster kommen von hier, Farben und
 * Schriften vom Theme. Der Kalender ist die Ausnahme; er braucht Farbe, um
 * frei von belegt zu unterscheiden, und benutzt dafuer `color-mix` auf der
 * Textfarbe des Themes statt eigener Farbwerte.
 *
 * Wichtig: Zustaende im Kalender sind nie nur farbig. Jeder Tag traegt ein
 * `aria-label` mit dem Zustand im Klartext, und belegte Tage sind zusaetzlich
 * durchgestrichen - Farbe allein waere fuer rund acht Prozent der Maenner
 * keine Unterscheidung.
 */

/* ------------------------------------------------------------------ Archiv */

.ghb-archive__header {
  margin-bottom: 1.5rem;
}

.ghb-archive__search {
  margin-bottom: 2rem;
}

.ghb-archive__empty {
  padding: 1.5rem;
  border: 1px dashed;
  border-color: color-mix(in srgb, currentColor 30%, transparent);
  border-radius: 0.6em;
}

/* ------------------------------------------------------------- Einzelseite */

.ghb-single__header {
  margin-bottom: 1.25rem;
}

.ghb-single__title {
  margin: 0 0 0.4rem;
}

.ghb-single__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
  font-size: 0.95em;
  opacity: 0.85;
}

.ghb-single__from-price {
  font-weight: 700;
  opacity: 1;
}

/*
 * Seit 3.104.6-dev steht die Galerie in der linken Spalte: Bild links,
 * Buchungsfeld mit Kalender rechts daneben. Vorher lief das Bild ueber die
 * ganze Breite, und der Kalender begann erst unterhalb davon - auf einem
 * ueblichen Bildschirm ausserhalb des sichtbaren Bereichs.
 */
.ghb-single__layout {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 1fr);
  align-items: start;
  margin-top: 1.5rem;
}

.ghb-single__content > .ghb-gallery-view:first-child .ghb-gallery-view__list {
  margin-top: 0;
}

.ghb-single__description {
  margin-top: 1.5rem;
}

@media (max-width: 56rem) {
  .ghb-single__layout {
    grid-template-columns: 1fr;
  }
}

.ghb-amenity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.4rem 1rem;
}

.ghb-amenity-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ----------------------------------------------------------------- Galerie */

.ghb-gallery-view__list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.5rem;
}

.ghb-gallery-view__item.is-primary {
  grid-column: 1 / -1;
}

.ghb-gallery-view__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0.5em;
}

/*
 * Hauptbild (3.104.7-dev): nie zuschneiden, nur verkleinern. Es behaelt sein
 * Seitenverhaeltnis und wird so gross wie die Spalte breit ist, hoechstens
 * aber 30rem hoch. Ein Hochformatbild wird dann schmaler und steht seit
 * 3.104.8-dev linksbuendig an der Spaltenkante.
 * Die kleinen Vorschaubilder darunter bleiben gleich gross zugeschnitten.
 */
.ghb-gallery-view__item.is-primary img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 30rem;
  object-fit: contain;
  margin: 0;
}

/* -------------------------------------------------------------- Lichtkasten */

.ghb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.88);
}

.ghb-lightbox[hidden] {
  display: none;
}

body.ghb-lightbox-open {
  overflow: hidden;
}

.ghb-lightbox__figure {
  margin: 0;
  max-width: min(90vw, 70rem);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ghb-lightbox__image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  margin: 0;
}

.ghb-lightbox__caption {
  color: #fff;
  text-align: center;
  font-size: 0.9em;
}

.ghb-lightbox__close,
.ghb-lightbox__nav {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  flex: none;
}

.ghb-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

/* ---------------------------------------------------------------- Kalender */

.ghb-calendar {
  margin-bottom: 1.25rem;
}

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

.ghb-calendar__nav {
  font: inherit;
  cursor: pointer;
  border: 1px solid currentColor;
  border-radius: 0.4em;
  background: transparent;
  color: inherit;
  padding: 0.2em 0.7em;
}

.ghb-calendar__status {
  font-size: 0.85em;
  opacity: 0.8;
}

.ghb-calendar__months {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.ghb-calendar__month {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.ghb-calendar__caption {
  font-weight: 700;
  padding-bottom: 0.4rem;
  text-align: center;
}

.ghb-calendar__month th {
  font-size: 0.75em;
  font-weight: 600;
  padding: 0.2rem 0;
  opacity: 0.75;
}

.ghb-calendar__month th abbr {
  text-decoration: none;
}

.ghb-calendar__month td {
  padding: 1px;
}

.ghb-calendar__day {
  width: 100%;
  min-height: 2.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font: inherit;
  font-size: 0.85em;
  line-height: 1.15;
  padding: 0.25rem 0.1rem;
  border: 1px solid transparent;
  border-radius: 0.35em;
  background: color-mix(in srgb, currentColor 8%, transparent);
  color: inherit;
  cursor: pointer;
}

.ghb-calendar__day[disabled] {
  cursor: default;
  opacity: 0.55;
  /* Nicht nur blass: durchgestrichen. Farbe und Deckkraft allein sind fuer
     Farbfehlsichtige keine Unterscheidung. */
  text-decoration: line-through;
}

.ghb-calendar__day.is-available {
  background: color-mix(in srgb, currentColor 4%, transparent);
  border-color: color-mix(in srgb, currentColor 25%, transparent);
}

.ghb-calendar__day.is-in-range {
  background: color-mix(in srgb, currentColor 18%, transparent);
}

.ghb-calendar__day.is-arrival,
.ghb-calendar__day.is-departure {
  background: color-mix(in srgb, currentColor 32%, transparent);
  border-color: currentColor;
  font-weight: 700;
}

.ghb-calendar__day:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

/* 3.104.8-dev: Preis im Tageskaestchen. Etwas kleiner als die Tageszahl,
   aber voll deckend - mit 0.8 Deckkraft war er auf hellem Grund kaum zu
   lesen. Darf nicht umbrechen, nur notfalls ueber den Rand schrumpfen. */
.ghb-calendar__price {
  display: block;
  max-width: 100%;
  font-size: 0.74em;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.ghb-calendar__day.is-available {
  min-height: 3rem;
  padding-left: 1px;
  padding-right: 1px;
}

.ghb-calendar__pad {
  background: transparent;
}

.ghb-calendar__hint,
.ghb-calendar__note {
  font-size: 0.85em;
  opacity: 0.85;
  margin: 0.5rem 0 0;
}

/* ------------------------------------------------------------ Buchungsfeld */

.ghb-booking-box {
  padding: 1rem;
  border: 1px solid;
  border-color: color-mix(in srgb, currentColor 20%, transparent);
  border-radius: 0.6em;
  position: sticky;
  top: 1rem;
}

.ghb-booking-box__title {
  margin: 0 0 0.75rem;
  font-size: 1.1em;
}

.ghb-booking-box__form {
  display: grid;
  gap: 0.6rem;
}

.ghb-booking-box__note {
  font-size: 0.8em;
  opacity: 0.8;
  margin: 0;
}

/* 3.104.14-dev: Inhaltsbereich, wenn das Plugin Kopf und Fuß eines Block-Themes
   selbst einsetzt (BlockThemeChrome). Breite wie die breite Inhaltsbreite des
   Themes, Abstand wie dessen Seitenrand. */
.ghb-block-theme-main {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--wp--style--global--wide-size, 1200px);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) var(--wp--style--root--padding-right, 1.25rem);
}
