/* Belegung (buchung.html and its /en/ /es/ /fr/ copies). Built on css/home.css: same palette, type,
   nav and footer, and the same month calendar (.plan-* classes, js/avail-core.js). This file holds
   the finder, the year strip and the panel with the chosen stay. */

/* ---------- page head ---------- */
.bhead { padding: clamp(36px, 6vw, 72px) 0 clamp(24px, 4vw, 44px); background-color: var(--sand); position: relative; isolation: isolate; }
.bhead::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: var(--tex-mares), var(--tex-grain); opacity: calc(.9 * var(--texture-strength)); mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bhead::before { mix-blend-mode: screen; } }
:root[data-theme="dark"] .bhead::before { mix-blend-mode: screen; }
.bhead h1 { font-size: clamp(2.2rem, 5.2vw, 3.8rem); margin-bottom: .3em; }
.blead { text-wrap: pretty; font-size: clamp(1.02rem, 1.5vw, 1.2rem); color: var(--ink-soft); max-width: 66ch; margin: 0 0 .9em; }
.bfresh { margin: 0; max-width: 72ch; font-size: .92rem; color: var(--ink-soft); padding-left: 14px; border-left: 2px solid var(--sun); }

/* ---------- layout ---------- */
.bapp { padding: clamp(24px, 4vw, 48px) 0 clamp(40px, 6vw, 72px); background: var(--paper); }
.bgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }
.bleft, .bright { display: grid; gap: 24px; min-width: 0; }
@media (min-width: 1100px) and (min-height: 820px) { .bright { position: sticky; top: 90px; } }
.bcard { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--radius) - 2px); padding: clamp(18px, 2.4vw, 28px); box-shadow: var(--shadow-sm); min-width: 0; }
.bcard h2 { font-size: clamp(1.35rem, 2vw, 1.7rem); margin: 0 0 .7em; }
.bhint { margin: .6em 0 0; font-size: .88rem; color: var(--ink-soft); }

/* ---------- finder ---------- */
.bfield { border: 0; padding: 0; margin: 0 0 1.1em; min-width: 0; }
.bfield legend { padding: 0; margin: 0 0 .5em; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--sea-ink); }
.bopts, .bmonths { display: flex; flex-wrap: wrap; gap: 8px; }
.bopt { position: relative; cursor: pointer; }
.bopt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.bopt span { display: grid; align-content: center; min-height: 48px; padding: 6px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); transition: border-color .2s, background .2s, color .2s; }
.bopt b { font-weight: 600; font-size: 15px; line-height: 1.25; }
.bopt small { font-size: 12.5px; color: var(--ink-soft); line-height: 1.25; }
.bopt:hover span { border-color: var(--sea-ink); }
.bopt input:checked + span { background: var(--sea); border-color: var(--sea); color: #fff; }
.bopt input:checked + span small { color: rgba(255, 255, 255, .85); }
.bopt input:focus-visible + span { outline: 3px solid #f0a57f; outline-offset: 2px; }
.bopt-month span { min-width: 54px; justify-items: center; padding-inline: 12px; }
.bfield-guests { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 1.1em; }
.bfield-guests label { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--sea-ink); }
.bfield-guests select { font: inherit; font-size: 16px; min-height: 44px; min-width: 150px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.bunit { margin: -.4em 0 1.1em; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--sea) 8%, var(--card)); font-size: .92rem; }
.bunit[hidden] { display: none; }
.bcount { margin: 1.2em 0 .5em; font-weight: 600; min-height: 1.4em; }
.bresults { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bresult { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.bgroup { margin: 10px 2px 0; font-size: .86rem; font-weight: 600; color: var(--ink-soft); }
.bgroup:first-child { margin-top: 0; }
.bresult-info { flex: 1; min-width: 0; }
.bresult-main { margin: 0; font-weight: 600; line-height: 1.3; }
.bresult-sub { margin: 2px 0 0; font-size: .86rem; color: var(--ink-soft); }
.bresult-take { flex: none; min-height: 44px; padding: 0 18px; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--sea-ink); background: transparent; border: 1.5px solid var(--sea-ink); border-radius: 999px; cursor: pointer; transition: background .2s, color .2s; }
.bresult-take:hover { background: var(--sea); color: #fff; border-color: var(--sea); }
.bresult-take:focus-visible { outline: 3px solid #f0a57f; outline-offset: 2px; }
.bresult-more { width: 100%; min-height: 48px; font: inherit; font-weight: 600; color: var(--sea-ink); background: transparent; border: 1.5px dashed var(--line); border-radius: 14px; cursor: pointer; }
.bresult-more:hover { border-color: var(--sea-ink); }
.bnone { margin: 1em 0 0; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--sun) 10%, var(--card)); font-size: .95rem; }
.bnone[hidden] { display: none; }
.bnone p { margin: 0 0 .5em; }
.bnone-next { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.bnone-next p { margin: 0; font-weight: 600; flex: 1 1 220px; }
.bshare { display: block; margin: .8em 0 0; min-height: 44px; padding: 0 4px; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--sea-ink); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- the year strip ---------- */
.byear-ruler { display: grid; grid-template-columns: repeat(31, 1fr); margin: 10px 0 2px 68px; font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.byear-ruler span { text-align: center; }
.byear-ruler span:nth-child(1) { grid-column: 1; text-align: left; }
.byear-ruler span:nth-child(2) { grid-column: 5; } .byear-ruler span:nth-child(3) { grid-column: 10; }
.byear-ruler span:nth-child(4) { grid-column: 15; } .byear-ruler span:nth-child(5) { grid-column: 20; }
.byear-ruler span:nth-child(6) { grid-column: 25; } .byear-ruler span:nth-child(7) { grid-column: 31; text-align: right; }
.byear-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.byear-row { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 4px; width: 100%; min-height: 32px; padding: 3px 4px 3px 0; font: inherit; color: inherit; text-align: left; background: none; border: 0; border-radius: 8px; cursor: pointer; }
.byear-row:hover { background: color-mix(in srgb, var(--sea) 7%, transparent); }
.byear-row:focus-visible { outline: 3px solid #f0a57f; outline-offset: 1px; }
.byear-label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); text-transform: capitalize; white-space: nowrap; }
.byear-cells { display: grid; grid-template-columns: repeat(31, 1fr); gap: 2px; }
.byear-cells i { display: block; height: 16px; border-radius: 3px; }
.byear-cells .is-void { visibility: hidden; }
.byear-cells .is-past { background: transparent; border: 1px dashed var(--line); }
.byear-cells .is-free { background: color-mix(in srgb, var(--sea-ink) 26%, var(--card)); }
.byear-cells .is-busy { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--sun) 46%, var(--card)) 0 3px, color-mix(in srgb, var(--sun) 24%, var(--card)) 3px 6px); }
.byear-cells .is-pick { background: var(--sea); }
.byear-cells .is-pick-start { background: var(--sea); box-shadow: 0 0 0 1.5px var(--card), 0 0 0 3px var(--sea); }
.byear-cells .is-today { outline: 1.5px solid var(--ink-soft); outline-offset: 1px; }
.byear .plan-legend { margin-top: 14px; }

/* ---------- calendar (the planner's, wider) ---------- */
.bcal h2 { padding-right: 96px; }
.bcal .plan-nav { top: clamp(14px, 1.8vw, 22px); right: clamp(14px, 1.8vw, 22px); }
.bcal .plan-months { grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 0; }
@media (max-width: 699px) { .bcal .plan-months { grid-template-columns: 1fr; } }
.bcal .plan-status { min-height: 1.5em; }

/* ---------- the chosen stay ---------- */
.bselect-empty { margin: 0; color: var(--ink-soft); }
.bselect-body[hidden], .bselect-empty[hidden] { display: none; }
.bselect-dates { margin: 0; font-family: var(--serif); font-size: clamp(1.35rem, 2.2vw, 1.75rem); line-height: 1.2; }
.bselect-nights { margin: .2em 0 1em; font-weight: 600; color: var(--sun-ink); white-space: nowrap; }
.boff { margin: .9em 0 0; font-size: .95rem; color: var(--ink-soft); }
@media (max-width: 699px) { .bapp.has-stay .boff { margin: .6em 0 0; font-size: .86rem; line-height: 1.35; } }
.boff[hidden] { display: none; }
.bselect-dates:empty, .bselect-nights:empty { display: none; }
.bselect-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.bselect-actions .btn { flex: 1 1 200px; }
.bselect-actions .btn[hidden] { display: none; }
.bselect-actions .ico { width: 1.15em; height: 1.15em; }
.btn-quiet { color: var(--sea-ink); background: transparent; border-color: var(--line); }
.btn-quiet:hover { border-color: var(--sea-ink); }

/* ---------- closing ---------- */
.bclosing { padding: clamp(40px, 6vw, 72px) 0; background: var(--sand); border-top: 1px solid var(--line); }
.bclosing-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; }
.bclosing h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: .2em; }
.bclosing p { margin: 0; color: var(--ink-soft); max-width: 56ch; }
.bclosing-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.bclosing-actions .ico { width: 1.15em; height: 1.15em; }

/* ---------- the calendar did not load: the card keeps what still works, the e-mail ---------- */
.bapp.is-error .bselect .bhint, .bapp.is-error .bselect-empty, .bapp.is-error .bselect .bshare { display: none; }

/* ---------- before the data arrives the page holds the room it will need, so nothing jumps when it comes ---------- */
.bapp:not(.is-ready):not(.is-error) #bmonths { min-height: 148px; }
.bapp:not(.is-ready):not(.is-error) #bresults { min-height: 420px; }
.bapp:not(.is-ready):not(.is-error) #byear { min-height: 440px; }
.bapp:not(.is-ready):not(.is-error) .plan-months { min-height: 330px; }

/* ---------- the calendar did not load ---------- */
.bapp.is-error .bfinder, .bapp.is-error .byear, .bapp.is-error .bcal .plan-months, .bapp.is-error .bcal .plan-nav, .bapp.is-error .bcal .plan-legend, .bapp.is-error .bcal .plan-hint { display: none; }

/* ---------- phones and tablets: one column, calendar before the year, the stay stays in reach ---------- */
@media (max-width: 1099px) {
  .bgrid { display: flex; flex-direction: column; gap: 20px; }
  .bgrid > *, .bcard { min-width: 0; align-self: stretch; }
  .bleft, .bright { display: contents; }
  .bfinder { order: 1; }
  .bcal { order: 2; }
  .bselect { order: 3; }
  .byear { order: 4; }
  .bapp.has-stay .bselect { position: sticky; bottom: 12px; z-index: 20; box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--sea-ink) 35%, var(--line)); }
}
@media (max-width: 699px) {
  /* the chosen stay stays in reach at the bottom of the screen, so it has to be small: dates and nights share a line,
     the two buttons are one line each, and the share link is a short row instead of a block */
  .bapp.has-stay .bselect { padding: 12px 14px 6px; }
  .bapp.has-stay .bselect h2, .bapp.has-stay .bselect .bhint { display: none; }
  .bapp.has-stay .bselect-dates { display: inline; font-size: 1.12rem; }
  .bapp.has-stay .bselect-nights { display: inline; margin: 0; font-size: .95rem; }
  .bapp.has-stay .bselect-nights::before { content: ' · '; font-weight: 400; color: var(--ink-soft); }
  .bapp.has-stay .bselect-actions { margin-top: 10px; flex-wrap: nowrap; gap: 8px; }
  .bapp.has-stay .bselect-actions .btn { flex: 1 1 0; min-width: 0; white-space: nowrap; padding-inline: .5em; }
  .bapp.has-stay .bselect-actions .ico { display: none; }
  .bapp.has-stay .bshare { margin: 0 auto; min-height: 44px; }
  .bresult { flex-wrap: wrap; }
  .bresult-take { width: 100%; }
}
@media (max-width: 359px) {
  .bapp.has-stay .bselect-actions { flex-wrap: wrap; }
  .bapp.has-stay .bselect-actions .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { .bopt span, .bresult-take { transition: none; } }
