/* Varauskalenteri (/varaa/). Ladataan vain varaussivulla.
   Kieli: ajanvarauskirja. Cormorant-numerot, hiusviivat, yksi kultainen
   merkki valitun päivän alla. Liike vain käyttäjän toiminnasta, hidas ja
   hillitty; vain transform/opacity; prefers-reduced-motion kunnioitetaan. */

/* Yksi ovi sisään: kalenteri on sivun päätoiminto. Soittopyyntö on sen alla
   hiljaisena, avattavana vaihtoehtona eikä kilpaile kalenterin kanssa. */
.booking-layout { max-width: 46rem; margin-inline: auto; }
.callback { margin-top: clamp(2.5rem, 5vw, 3.5rem); border-top: 1px solid var(--line); }
.callback > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.6rem 0 0.4rem;
  cursor: pointer;
  color: var(--ink-soft);
  transition: color 0.35s var(--ease);
}
.callback > summary::-webkit-details-marker { display: none; }
.callback > summary h3 {
  font-size: clamp(1.25rem, 1.8vw, 1.45rem);
  font-weight: 600;
  color: inherit;
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.1rem;
}
.callback-chev { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.4; transition: transform 0.35s var(--ease); }
.callback[open] .callback-chev { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) {
  .callback > summary:hover { color: var(--ink); }
}
.callback > summary:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 4px; }
.callback-lede { text-align: center; margin: 0.6rem auto 1.5rem; color: var(--ink-soft); }
.callback[open] .visit-card { animation: bk-fade 0.35s var(--ease) backwards; }

.bk {
  --bk-line: rgba(29, 24, 17, 0.12);
  --bk-day-w: 3.6rem;
  --bk-week-gap: 1.1rem;
  position: relative;
  background: var(--pure);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 2.4rem);
  min-height: 29rem;
}
.bk [hidden] { display: none !important; }

.bk-demo {
  position: absolute;
  bottom: 0.7rem;
  right: 0.9rem;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  opacity: 0.7;
}

/* ---------- Kuukausi + nuolet ---------- */
.bk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.bk-month {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.45rem;
  line-height: 1.2;
  color: var(--ink);
}
.bk-nav { display: flex; gap: 0.35rem; }
.bk-arrow {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--bk-line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.35s var(--ease), opacity 0.35s var(--ease), transform 0.16s ease-out;
}
.bk-arrow svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.bk-arrow:disabled { opacity: 0.3; cursor: default; }
.bk-arrow:active:not(:disabled) { transform: scale(0.95); }
@media (hover: hover) and (pointer: fine) {
  .bk-arrow:hover:not(:disabled) { border-color: var(--ink); }
}

/* ---------- Päivärivi ---------- */
.bk-strip-wrap {
  position: relative;
  margin: 0 calc(-1 * clamp(1.4rem, 3vw, 2.4rem));
  border-top: 1px solid var(--bk-line);
  border-bottom: 1px solid var(--bk-line);
}
/* Reunahäivytys vihjaa, että rivi jatkuu. */
.bk-strip-wrap::before,
.bk-strip-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(1.4rem, 3vw, 2.4rem);
  pointer-events: none;
  z-index: 2;
}
.bk-strip-wrap::before { left: 0; background: linear-gradient(90deg, var(--pure), rgba(255, 255, 255, 0)); }
.bk-strip-wrap::after { right: 0; background: linear-gradient(270deg, var(--pure), rgba(255, 255, 255, 0)); }

.bk-strip {
  position: relative;
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: clamp(1.4rem, 3vw, 2.4rem);
  scrollbar-width: none;
  padding: 0.9rem clamp(1.4rem, 3vw, 2.4rem) 0.75rem;
}
.bk-strip::-webkit-scrollbar { display: none; }

.bk-day {
  flex: 0 0 var(--bk-day-w);
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  padding: 0.35rem 0 0.55rem;
  background: none;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.bk-day.week-end { margin-right: var(--bk-week-gap); }
.bk-wd {
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.bk-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.9rem;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  transition: color 0.35s var(--ease);
}
.bk-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}
.bk-day.is-full .bk-dot,
.bk-day.is-closed .bk-dot { background: transparent; }
.bk-day.is-full .bk-num,
.bk-day.is-closed .bk-num { color: rgba(29, 24, 17, 0.3); }
.bk-day.is-closed .bk-num { text-decoration: line-through; text-decoration-thickness: 1px; }
.bk-day[aria-checked="true"] .bk-num { color: var(--gold-deep); }
.bk-day[aria-checked="true"] .bk-wd { color: var(--ink); }
.bk-day:focus-visible { outline: 1px solid var(--gold); outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) {
  .bk-day:not([aria-checked="true"]):hover .bk-num { color: var(--gold-deep); }
  .bk-day.is-full:not([aria-checked="true"]):hover .bk-num,
  .bk-day.is-closed:not([aria-checked="true"]):hover .bk-num { color: rgba(29, 24, 17, 0.5); }
}

/* Valitun päivän merkki: yksi hiusviiva, joka liukuu päivästä toiseen. */
.bk-mark {
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--bk-day-w);
  height: 2px;
  background: var(--gold);
  transform: translateX(var(--x, 0px));
  transition: transform 0.6s var(--ease);
  pointer-events: none;
}
.bk-mark.no-anim { transition: none; }

/* ---------- Ajat ---------- */
.bk-panel { padding-top: 1.6rem; }
.bk-day-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.45rem, 2.2vw, 1.75rem);
  line-height: 1.15;
  margin-bottom: 1.1rem;
  min-height: 1.15em;
}
.bk-slots {
  display: grid;
  /* 4 saraketta: päivän 7 aikaa asettuvat 4 + 3, ei yksinäistä viimeistä. */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}
.bk-slot {
  height: 3.3rem;
  border: 1px solid var(--bk-line);
  border-radius: var(--radius);
  background: var(--pure);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.35s var(--ease), color 0.35s var(--ease), background-color 0.35s var(--ease), transform 0.16s ease-out;
}
.bk-slot:active { transform: scale(0.97); }
.bk-slot:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .bk-slot:hover { border-color: var(--gold); color: var(--gold-deep); }
}
.bk-slot.is-picked { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Ajat tulevat esiin hiljaa päivää vaihdettaessa. */
.bk-slots.is-in .bk-slot {
  animation: bk-in 0.5s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 35ms);
}
@keyframes bk-in {
  from { opacity: 0; transform: translateY(6px); }
}

.bk-note {
  margin-top: 1.1rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.bk-note a, .bk-link {
  color: var(--gold-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.bk-empty { grid-column: 1 / -1; font-size: 0.95rem; color: var(--ink-soft); max-width: 40ch; padding: 0.2rem 0 0.4rem; }
.bk-empty .bk-link { display: inline-block; margin-top: 0.5rem; text-align: left; }
.bk.is-error .bk-bar,
.bk.is-error .bk-strip-wrap { display: none; }
.bk.is-error .bk-panel { padding-top: 0.4rem; }
.bk.is-error { min-height: 0; }
.bk-alert {
  border-left: 2px solid var(--gold);
  padding: 0.2rem 0 0.2rem 0.9rem;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
}

/* ---------- Latausnäkymä ---------- */
.bk-sk {
  display: block;
  background: var(--warm);
  border-radius: var(--radius);
  animation: bk-pulse 1.8s ease-in-out infinite alternate;
}
.bk-sk-day { flex: 0 0 var(--bk-day-w); height: 3.9rem; margin-right: 0.4rem; background: linear-gradient(var(--warm), var(--warm)) center / 70% 100% no-repeat; }
.bk-sk-slot { height: 3.3rem; }
.bk-sk-title { width: 13rem; max-width: 70%; height: 1.4rem; margin-top: 0.1rem; }
@keyframes bk-pulse { from { opacity: 1; } to { opacity: 0.45; } }

/* ---------- Vaihe 2: lomake ---------- */
.bk-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.3rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--bk-line);
}
.bk-sum-when {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.45rem, 2.2vw, 1.75rem);
  line-height: 1.2;
  outline: none;
}
.bk-sum-time { display: block; color: var(--ink-soft); font-variant-numeric: lining-nums; }
.bk-sum-where { font-size: 0.86rem; color: var(--ink-soft); margin-top: 0.45rem; }
.bk-back {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 2.75rem;
  padding: 0 0.2rem;
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--gold-deep);
  cursor: pointer;
}
.bk-back svg { width: 0.95rem; height: 0.95rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.35s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .bk-back:hover svg { transform: translateX(-3px); }
}
.bk-form { display: grid; gap: 1.1rem; }
.bk-form .field textarea { min-height: 6rem; }
.bk-opt { font-weight: 400; color: var(--ink-soft); }
.bk-err { font-size: 0.8rem; color: #8a2f1d; min-height: 0; }
.bk-err:empty { display: none; }
.bk-form [aria-invalid="true"] { border-color: #8a2f1d; }
.bk-form-err { font-size: 0.88rem; color: #8a2f1d; }
.bk-form-err a { color: inherit; text-decoration: underline; }
.bk-submit { justify-self: start; }
.bk-submit[aria-disabled="true"] { opacity: 0.6; cursor: progress; }

/* ---------- Vaihe 3: vahvistus ---------- */
.bk-done { text-align: center; padding: 1.5rem 0 0.5rem; }
.bk-check {
  width: 3.4rem;
  height: 3.4rem;
  margin: 0 auto 1.3rem;
  display: block;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bk-check circle { stroke-dasharray: 139; stroke-dashoffset: 0; }
.bk-check path { stroke-dasharray: 30; stroke-dashoffset: 0; }
.bk-done.is-in .bk-check circle { animation: bk-draw 1.1s var(--ease) backwards; }
.bk-done.is-in .bk-check path { animation: bk-draw-p 0.7s var(--ease) 0.55s backwards; }
@keyframes bk-draw { from { stroke-dashoffset: 139; } }
@keyframes bk-draw-p { from { stroke-dashoffset: 30; } }
.bk-done-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  line-height: 1.1;
  margin-bottom: 1.6rem;
  outline: none;
}
.bk-done-list {
  max-width: 26rem;
  margin: 0 auto 1.8rem;
  border-top: 1px solid var(--bk-line);
  text-align: left;
}
.bk-done-list > div {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--bk-line);
}
.bk-done-list dt { font-size: 0.8rem; color: var(--ink-soft); padding-top: 0.15rem; }
.bk-done-list dd { font-size: 0.95rem; }

/* Vaiheiden vaihto: lyhyt ristihäivytys, ei liukumista. */
.bk-step.is-entering { animation: bk-step 0.45s var(--ease) backwards; }
@keyframes bk-step { from { opacity: 0; transform: translateY(8px); } }

.bk-noscript { font-size: 0.95rem; color: var(--ink-soft); }
.bk-noscript a { color: var(--gold-deep); text-decoration: underline; }

@media (max-width: 900px) {
}
@media (max-width: 640px) {
  .bk { --bk-day-w: 3.35rem; --bk-week-gap: 0.8rem; min-height: 0; padding: 1.4rem 1.25rem 1.6rem; }
  .bk-strip-wrap { margin: 0 -1.25rem; }
  .bk-strip { padding-inline: 1.25rem; scroll-padding-inline: 1.25rem; }
  .bk-strip-wrap::before, .bk-strip-wrap::after { width: 1.25rem; }
  .bk-nav { display: none; }
  .bk-num { font-size: 1.75rem; }
  .bk-slots { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.45rem; }
  .bk-slot { font-size: 1.2rem; }
  .bk-summary { flex-direction: column; gap: 0.1rem; padding-bottom: 0.9rem; margin-bottom: 1.3rem; }
  .bk-back { margin-left: -0.2rem; }
  .bk-submit { justify-self: stretch; }
  .bk-done-list > div { grid-template-columns: 4.6rem 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .bk-mark { transition: none; }
  .bk-slots.is-in .bk-slot,
  .bk-step.is-entering { animation: bk-fade 0.2s ease backwards; }
  .bk-sk { animation: none; }
  .bk-done.is-in .bk-check circle,
  .bk-done.is-in .bk-check path { animation: none; }
}
@keyframes bk-fade { from { opacity: 0; } }

/* "Lisää kalenteriin" lataa tiedoston, joten siinä ei ole siirtymänuolta. */
.bk-ics::after { content: none; }

/* /varaa/: kalenteri on päätoiminto, joten otsikko ja ingressi ovat
   tiiviimmät, ja vapaat ajat näkyvät avausnäkymässä (1440x900: päivärivi
   ja ensimmäinen aikarivi; 390x844: päivärivi). Tekstit ennallaan. */
.page-hero--compact { padding: clamp(1.75rem, 4vh, 3rem) 0 clamp(1rem, 2vh, 1.5rem); }
.page-hero--compact h1 { font-size: clamp(2.3rem, 4.2vw, 3.6rem); margin-bottom: 0.7rem; max-width: none; }
.page-hero--compact .lede { font-size: clamp(1rem, 1.3vw, 1.12rem); line-height: 1.6; max-width: 58ch; }
.booking-main > h3 { margin-bottom: 0.5rem !important; }
.booking-main > p { margin-bottom: 1.1rem !important; }
