/* Building pages - page-specific only. The design system, gallery,
   lightbox, fact bar and inclusions grid all live in css/all/cgk-site-style.css */
.hero {
  min-height: clamp(520px, 78vh, 740px);
  padding-block: clamp(7rem, 13vw, 10rem) clamp(2.5rem, 5vw, 3.5rem);
}

.hero h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); max-width: 24ch; margin-top: 1.25rem; }

/* ================================================================
   The viewing calendar (Phase 4d), injected into #visit-form by
   js/shared/booking.js.

   Our own palette, not the reference implementation's: one colour used
   tonally, 2px radii, serif numerals, hairline rules. Days are squares
   with a 2px radius rather than circles - circles read as an app, and
   the client rejected exactly that.

   A day the server did not send is drawn but never clickable, because
   a missing square reads as a rendering fault while a greyed one reads
   as "nobody is free". It is a <span>, not a disabled <button>, so it
   is skipped by the keyboard rather than trapping it.
   ================================================================ */

.cal {
  margin: 1.35rem 0 0;
  padding: 1.15rem 1.15rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
}

.cal-head { margin-bottom: .9rem; }

.cal-title {
  margin: 0 0 .2rem;
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand);
}

.cal-help {
  margin: 0;
  font-size: .84rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* ---- month bar ---- */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .35rem 0 .7rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: .6rem;
}

.cal-month {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
}

.cal-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.cal-arrow svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cal-arrow:hover:not(:disabled) {
  background: var(--brand-wash);
  border-color: var(--brand);
}

/* Disabled rather than hidden: the control keeps its place, so the
   month name does not jump sideways at the ends of the range. */
.cal-arrow:disabled {
  opacity: .3;
  cursor: not-allowed;
}

/* ---- the grid ---- */
.cal-dow,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-dow {
  margin-bottom: 4px;
}

.cal-dow span {
  text-align: center;
  padding: .3rem 0;
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.cal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  min-height: 2.1rem;
  padding: 0;
  font-family: var(--serif);
  font-size: .95rem;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
}

.cal-day.is-blank { visibility: hidden; }

button.cal-day {
  cursor: pointer;
  background: var(--brand-wash);
  transition: background .16s ease, color .16s ease,
              border-color .16s ease, transform .12s ease;
}

button.cal-day:hover {
  background: var(--brand);
  color: var(--on-brand);
  /* One pixel. Enough to feel live, small enough not to reflow the row. */
  transform: translateY(-1px);
}

button.cal-day:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.cal-day.is-today { border-color: var(--brand); }

.cal-day.is-on,
button.cal-day.is-on:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: var(--on-brand);
  transform: none;
}

/* Nobody is free. Readable, obviously inert, never clickable. */
.cal-day.is-off {
  color: var(--ink-soft);
  opacity: .38;
  cursor: default;
}

/* ---- the hours for the chosen day ---- */
.cal-times {
  margin-top: .95rem;
  padding-top: .85rem;
  border-top: 1px solid var(--line);
}

.cal-times-label {
  margin: 0 0 .55rem;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand);
}

.cal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.cal-chip {
  padding: .42rem .7rem;
  font-family: var(--serif);
  font-size: .9rem;
  color: var(--ink);
  background: var(--brand-wash);
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.cal-chip:hover { background: var(--brand); color: var(--on-brand); }
.cal-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.cal-chip.is-on,
.cal-chip.is-on:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: var(--on-brand);
}

/* ---- status ----
   role="status", so a screen reader is told what happened without the
   focus moving. Empty takes no room at all. */
.cal-msg {
  margin: .85rem 0 0;
  font-size: .85rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.cal-msg:empty { display: none; }
.cal-msg.is-ok { color: var(--brand-deep); }
.cal-msg.is-error { color: #A3352C; }

/* A box the booking still needs (booking.js). Same red as the message. */
.form input.is-invalid,
.form select.is-invalid,
.form textarea.is-invalid { border-color: #A3352C; box-shadow: 0 0 0 1px #A3352C; }

/* The working indicator. Drawn, not an emoji: an emoji is a different
   typeface at a different weight in every browser, and the client
   rejected anything that read as "techy". */
.cal-spin {
  display: inline-block;
  width: .72rem;
  height: .72rem;
  margin-right: .45rem;
  vertical-align: -1px;
  border: 2px solid var(--brand-wash);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: cal-spin .7s linear infinite;
}

@keyframes cal-spin { to { transform: rotate(360deg); } }

/* Restrained motion means none at all for anyone who has asked for
   none. The indicator stays visible, it simply stops turning. */
@media (prefers-reduced-motion: reduce) {
  .cal-spin { animation: none; }
  button.cal-day,
  .cal-chip,
  .cal-arrow { transition: none; }
  button.cal-day:hover { transform: none; }
}

/* ---- the confirmation, which replaces the calendar ---- */
.cal-done {
  padding: 1.1rem;
  background: var(--brand-wash);
  border-radius: 2px;
}

.cal-done-h {
  margin: 0 0 .5rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--brand-deep);
}

.cal-done-b {
  margin: 0 0 .2rem;
  font-size: .9rem;
  color: var(--ink);
}

.cal-done-ref {
  margin: .6rem 0 0;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
