/* EO WEB – Figma "MacBook Pro 16" (1728 × 1117). 1 Figma-px = --u.
   Spaltenraster: 12 Spalten, 16 px Rand, 16 px Abstand → Spalte i beginnt bei 16 + i·142,67. */
:root {
  --u: calc(100vw / 1728);
  --ink: #442311;                       /* TEXT BROWN */
  --muted: rgba(68, 35, 17, 0.4);       /* TEXT BROWN, nicht ausgewählt */
  --paper: #EDEBE4;                     /* OFF WHITE */
  --range: rgba(68, 35, 17, 0.08);
  --placeholder: #e2dfd6;
  --big: calc(var(--u) * 20);
  --small: max(calc(var(--u) * 14), 12px);
  --gap: calc(var(--u) * 16);
  --col: calc(var(--u) * 142.6667);     /* Spalte + Abstand */
  --span3: calc(var(--u) * 412);        /* 3 Spalten */
  --header: calc(var(--u) * 317);
  --img-top-form: calc(var(--u) * 727);
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: var(--big);
  line-height: normal;
  -webkit-font-smoothing: antialiased;
}
body.view-carousel, body.form-open { height: 100svh; overflow: hidden; }
p, h2 { margin: 0; font: inherit; }
.h2 { display: block; }
u { text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
[hidden] { display: none !important; }
::selection { background: var(--ink); color: var(--paper); }

/* Alles Klickbare: Linie beim Hovern */
.link, .send {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer; text-decoration: none; text-align: left;
  text-decoration-thickness: 1px; text-underline-offset: 0.18em;
}
/* nur bei echter Maus – auf dem Handy bleibt :hover nach dem Antippen sonst „hängen“ */
@media (hover: hover) { .link:hover, .send:hover { text-decoration-line: underline; } }
.link:focus-visible, .send:focus-visible { text-decoration-line: underline; outline: none; }
.link.u { text-decoration-line: underline; }
.block { display: block; }
.small { font-size: var(--small); }

/* ---------- Sprache / Zurück ---------- */
.lang { position: fixed; top: var(--gap); right: var(--gap); z-index: 30; }
.back { display: none; }

/* ---------- HEADER ---------- */
.intro {
  position: fixed; inset: 0 0 auto 0; height: var(--header); z-index: 20;
  background: var(--paper);
  transition: opacity .35s var(--ease);
}
.pick { position: absolute; left: var(--gap); top: var(--gap); white-space: nowrap; }
.place[aria-pressed="false"], .view[aria-pressed="false"] { color: var(--muted); }
.place[aria-pressed="true"], .view[aria-pressed="true"] { cursor: default; }
.place[aria-pressed="true"] { text-decoration-line: underline; }   /* ausgewähltes Objekt hervorheben */
.view[aria-pressed="true"]:hover { text-decoration-line: none; }
@media (hover: hover) { .place[aria-pressed="false"]:hover, .view[aria-pressed="false"]:hover { color: var(--ink); } }
#summary { text-decoration-line: none; }
#summary[aria-expanded="true"] { text-decoration-line: underline; }   /* nur ausgeklappt unterstrichen */
@media (hover: hover) { #summary:hover { text-decoration-line: underline; } }
.then { position: absolute; left: calc(var(--u) * 588); top: var(--gap); white-space: nowrap; }
.offer { position: absolute; left: calc(var(--u) * 1006); top: var(--gap); width: calc(var(--u) * 706); }
.description {
  font-size: var(--small); margin-top: calc(var(--u) * 30);
  display: flex; flex-direction: column; gap: 1.15em;
}
.cta { margin-top: calc(var(--u) * 30); }   /* Oberkanten 16 → 96: 80 px Raster */
.description:not([hidden]) + .cta { margin-top: calc(var(--u) * 20); }
.views { position: absolute; left: var(--gap); top: calc(var(--u) * 284); display: flex; gap: 0.75em; white-space: nowrap; }

/* ---------- Karussell ---------- */
.carousel {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: max(calc(100svh - var(--header)), 160px);
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  cursor: grab;
  transition: height .7s var(--ease);
  overscroll-behavior-x: contain;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel.dragging { cursor: grabbing; }
.track { display: flex; gap: var(--gap); height: 100%; width: max-content; }
.track img, .rooms img {
  object-fit: cover; display: block; flex: none;
  user-select: none; -webkit-user-drag: none;
  background: var(--placeholder);
}
.track img { height: 100%; aspect-ratio: 555 / 800; width: auto; pointer-events: none; }

/* ---------- Room view ---------- */
.rooms { display: none; padding: var(--header) 0 calc(var(--u) * 80); }
body.view-rooms .rooms { display: block; }
body.view-rooms .carousel { display: none; }
.room {
  display: grid;
  grid-template-columns: calc(var(--u) * 269.33) repeat(3, var(--span3));
  column-gap: var(--gap);
  row-gap: var(--gap);                  /* gleicher Abstand wie horizontal, großer Abstand nur zwischen Zimmern */
  padding-left: var(--gap);
  margin-bottom: calc(var(--u) * 80);
  align-items: center;
}
.room h3 { margin: 0; font: inherit; font-weight: normal; }
.room img { width: 100%; aspect-ratio: 412 / 594; height: auto; }
.room h3 { grid-column: 1; grid-row: 1; }
.room img:nth-of-type(3n+1) { grid-column: 2; }

/* ---------- Bild groß ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: var(--paper);
  display: flex; flex-direction: column;
}
.lightbox-title { padding: 16px 56px 16px 16px; }
/* Bilder des Raums: wischen, rastet pro Bild ein, Endlosschleife (app.js) */
.lightbox-track {
  flex: 1; min-height: 0; display: flex; padding-bottom: 16px;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain; scrollbar-width: none;
}
.lightbox-track::-webkit-scrollbar { display: none; }
.lightbox-slide {
  flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always;
  display: flex; align-items: center; justify-content: center; padding: 0 16px;
}
.lightbox-slide img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; }
.lightbox-close { position: absolute; top: 16px; right: 16px; font-size: 20px; line-height: 1; }
body.lightbox-open { overflow: hidden; }

/* ---------- Formular (Figma FORMULAR LAYOUT) ---------- */
.inquiry {
  position: absolute; inset: 0 0 auto 0; height: var(--img-top-form);
  opacity: 0; visibility: hidden;
  transition: opacity .45s var(--ease), visibility 0s .45s;
}
.inquiry > * { position: absolute; }
.inquiry > .hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }   /* Spam-Falle */
.f-title { left: var(--gap); top: var(--gap); white-space: nowrap; }
.q-line { top: calc(var(--u) * 110); width: var(--span3); display: flex; align-items: baseline; gap: 0.25em; white-space: nowrap; cursor: text; }
.f-name { left: var(--gap); }
.f-mail, .f-questions { left: calc(var(--gap) + 4 * var(--col)); }
.f-phone, .f-dates, .f-send { left: calc(var(--gap) + 8 * var(--col)); }
.f-dates, .f-about, .f-questions { top: calc(var(--u) * 182); width: var(--span3); }
.f-about { left: var(--gap); }
.f-dates h2, .q-area .h2 { height: calc(var(--u) * 50); white-space: nowrap; }
.q-area { cursor: text; }
.f-send { top: calc(var(--u) * 587); width: var(--span3); }
.f-regards { left: calc(var(--gap) + 10 * var(--col)); top: calc(var(--u) * 587); line-height: normal; white-space: nowrap; }

.field { position: relative; display: block; }
.q-line .field { flex: 1; min-width: 0; }
.area { height: calc(var(--u) * 327); }
textarea, input {
  font: inherit; color: var(--ink); line-height: normal;
  background: transparent; border: 0; outline: none; padding: 0; margin: 0;
  width: 100%; caret-color: var(--ink); border-radius: 0;
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: default;   /* Einfügen auf iOS */
}
textarea { height: 100%; resize: none; display: block; font-size: var(--small); }
/* Cursor erscheint beim Hovern über die Frage (blinkt nicht) */
.caret {
  position: absolute; left: 0; top: 0.12em; width: 1px; height: 1.1em;
  background: var(--ink); pointer-events: none; opacity: 0;
}
.area .caret { font-size: var(--small); }
.q:hover .caret { opacity: 1; }
.field:focus-within .caret, .field.filled .caret { opacity: 0 !important; }

.send { display: block; }
.status { margin-top: 0.6em; min-height: 1.2em; max-width: calc(var(--u) * 269.33); }   /* endet vor den Kontaktdaten (Spalte 10) */
.inquiry.sent .send { pointer-events: none; }

/* Kalender (Figma Frame 3) */
.calendar { font-size: var(--small); user-select: none; }
.cal-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; margin-bottom: 0.9em; }
.cal-head .month { text-align: center; }
.cal-head .link:disabled { color: var(--muted); opacity: .5; cursor: default; text-decoration-line: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }
.cal-grid .wd { color: var(--muted); text-align: center; padding-bottom: 0.5em; }
.day {
  font: inherit; color: inherit; background: none; border: 0; padding: 0;
  height: max(calc(var(--u) * 30), 22px); text-align: center; cursor: pointer;
  text-decoration-thickness: 1px; text-underline-offset: 0.18em;
}
.day:hover:not(:disabled) { text-decoration-line: underline; }
.day:disabled { color: var(--muted); opacity: .5; cursor: default; }
.day.in-range { background: var(--range); }
.day.start, .day.end { background: var(--ink); color: var(--paper); }
.day.empty { visibility: hidden; }
.range { margin-top: 0.9em; display: flex; gap: 1.6em; }
.range b { font-weight: normal; }
.inquiry .invalid > span:first-child, .inquiry .invalid.range { color: #a3200e; }

/* ---------- Zustand: Formular offen ---------- */
body.form-open .intro, body.form-open .rooms { opacity: 0; pointer-events: none; }
body.form-open .rooms { display: none; }
body.form-open .carousel { display: block; height: max(calc(100svh - var(--img-top-form)), 140px); }
body.form-open .inquiry { opacity: 1; visibility: visible; transition: opacity .45s var(--ease) .1s, visibility 0s; }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 999px) {
  :root { --big: 17px; --small: 14px; --gap: 16px; --u: 1px; }
  body.view-carousel, body.form-open { height: auto; overflow: auto; }
  .lang { position: absolute; }
  .intro, .inquiry { position: static; height: auto; padding: 16px; padding-right: 56px; }
  .pick, .then, .offer, .views { position: static; white-space: normal; width: auto; }
  .then { margin-top: 32px; }
  .offer { margin-top: 32px; }
  /* Dropdown-Pfeil rechts neben der Kurzbeschreibung, dreht sich beim Ausklappen */
  #summary { position: relative; }
  #summary br { display: none; }   /* mobil: Verfügbarkeit direkt nach dem Ort */
  #summary::after {
    /* rechtsbündig mit der Sprachauswahl (16px vom Rand; .intro hat rechts 56px Innenabstand) */
    content: ''; position: absolute; right: -38px; top: 0.35em;
    width: 7px; height: 7px; border: solid var(--ink); border-width: 0 1px 1px 0;
    transform: rotate(45deg); transition: transform .3s var(--ease), top .3s var(--ease);
  }
  #summary[aria-expanded="true"]::after { transform: rotate(-135deg); top: 0.6em; }
  .description { margin-top: 20px; }
  .cta, .description:not([hidden]) + .cta { margin-top: 24px; }
  .views { margin-top: 36px; }
  body.form-open .back { display: block; position: absolute; top: 16px; left: 16px; z-index: 30; }
  .inquiry { padding-top: 72px; }   /* Text unter Zurück / Sprache */
  .room img { cursor: zoom-in; }
  .carousel { position: relative; height: min(68svh, 115vw); margin: 0 0 16px; }
  body.form-open .carousel { height: min(46svh, 85vw); }
  body.form-open .intro { display: none; }
  body:not(.form-open) .inquiry { display: none; }
  .inquiry { visibility: visible; opacity: 1; display: grid; gap: 28px; padding-right: 16px; }
  .inquiry > * { position: static; width: auto !important; white-space: normal; }
  .f-title { padding-right: 40px; }
  .f-dates h2, .q-area .h2 { height: auto; margin-bottom: 12px; white-space: normal; }
  .area { height: 160px; }
  .day { height: 36px; }
  .rooms { padding: 0 0 40px; }
  .room { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 16px; margin-bottom: 32px; }
  .room h3 { grid-column: 1 / -1; }
  .room img:nth-of-type(3n+1) { grid-column: auto; }
  .caret { opacity: 1; }
}
@media (hover: none) { .q .caret { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .carousel, .intro, .inquiry { transition: none; }
}
