/* Dharā booking page. Palette and type follow dharaecovillage.in:
   Marcellus headings, Gentium body, cream paper, sand, sage, forest green, laterite. */

:root {
  --paper: #FDF9F3;
  --paper-deep: #F6EEE2;
  --sand: #E3D5C1;
  --sand-line: #D6C4AA;
  --sage: #6D7B5E;
  --sage-soft: #E4E8DC;
  --forest: #0B2D0D;
  --ink: #2C3E2D;
  --muted: #5F6B55;
  --laterite: #B5592F;        /* buttons: 4.6:1 with white text */
  --laterite-hover: #9C4A25;
  --laterite-soft: #F5E2D6;
  --danger: #A8321E;

  --display: 'Marcellus', 'Iowan Old Style', Georgia, serif;
  --body: 'Gentium Book Plus', 'Gentium Basic', Georgia, serif;

  --radius-s: 6px;
  --radius-m: 14px;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--laterite); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--sage); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  color: var(--forest);
  line-height: 1.2;
  margin: 0;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header and hero ---------- */

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px var(--gutter);
  max-width: 1160px; margin: 0 auto;
}
.site-header .logo img { height: 44px; width: auto; }
@media (min-width: 760px) { .site-header .logo img { height: 52px; } }
.site-header .back { font-size: 1rem; color: var(--muted); text-decoration: none; }
.site-header .back:hover { color: var(--forest); text-decoration: underline; }

.hero {
  position: relative;
  margin: 0 auto;
  max-width: 1160px;
  padding: 0 var(--gutter);
}
.hero-frame {
  position: relative;
  border-radius: var(--radius-m);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--sand);
}
.hero-frame img {
  width: 100%; height: 100%; object-fit: cover;
  transition: opacity .5s ease;
}
.hero-frame::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(11, 45, 13, .78) 0%, rgba(11, 45, 13, .2) 55%, rgba(11, 45, 13, 0) 75%);
}
.hero-copy {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: 20px;
  color: var(--paper);
}
.hero-copy h1 {
  color: var(--paper);
  font-size: clamp(2.1rem, 8vw, 4.2rem);
  letter-spacing: -.01em;
}
.hero-copy p { margin: 8px 0 0; max-width: 34em; font-size: 1rem; line-height: 1.5; opacity: .92; }
@media (min-width: 760px) { .hero-copy p { font-size: 1.05rem; } }

/* The labyrinth from the logo, drawn large into the hero corner. */
.hero-frame .hero-mark {
  position: absolute; z-index: 1; right: -28px; top: -20px;
  width: 150px; height: auto; opacity: .5;
  filter: invert(1);
  pointer-events: none;
}

@media (min-width: 760px) {
  .hero-frame { aspect-ratio: 21 / 8; }
  .hero-copy { padding: 36px 44px; }
  .hero-frame .hero-mark { width: 260px; right: -40px; top: -40px; }
}

/* ---------- Booking type switch ---------- */

.switch {
  display: flex; gap: 4px;
  margin: 24px auto 0;
  padding: 4px;
  max-width: 1160px;
  width: calc(100% - 2 * var(--gutter));
  background: var(--paper-deep);
  border: 1px solid var(--sand);
  border-radius: 999px;
}
.switch button {
  flex: 1;
  border: 0; background: transparent; cursor: pointer;
  padding: 10px 12px; border-radius: 999px;
  font-family: var(--display); font-size: 1.05rem; color: var(--muted);
  white-space: nowrap;
}
@media (min-width: 760px) { .switch button { padding: 10px 24px; } }
.switch button[aria-selected='true'] { background: var(--forest); color: var(--paper); }
@media (min-width: 760px) { .switch { width: auto; display: inline-flex; margin-left: max(var(--gutter), calc((100% - 1160px) / 2 + var(--gutter))); } }

/* ---------- Layout ---------- */

/* min-width: 0 keeps wide children (carousels, calendars) from stretching the column past the screen. */
.layout > * { min-width: 0; }
.layout {
  max-width: 1160px; margin: 0 auto;
  grid-template-columns: minmax(0, 1fr);
  padding: 8px var(--gutter) 140px;
  display: grid; gap: 32px;
}
@media (min-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 56px; padding-bottom: 80px; }
}

.step { padding: 28px 0 8px; border-top: 1px solid var(--sand); }
.step:first-child { border-top: 0; }
.step-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.step-head h2 { font-size: 1.6rem; }
.step-num {
  flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-grid; place-items: center;
  border: 1px solid var(--sage); color: var(--sage);
  font-family: var(--display); font-size: 1rem;
  transform: translateY(-3px);
}
.step.is-done .step-num { background: var(--sage); color: var(--paper); }
.step-hint { color: var(--muted); margin: -8px 0 16px; font-size: 1rem; }

/* ---------- Calendar ---------- */

.cal-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-toolbar .range-text { font-size: 1rem; color: var(--muted); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--sand-line); background: var(--paper); cursor: pointer;
  display: inline-grid; place-items: center; color: var(--forest);
}
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; }

.cal-months { display: grid; gap: 28px; }
@media (min-width: 680px) { .cal-months { grid-template-columns: 1fr 1fr; } }

.cal-month h3 { font-size: 1.15rem; margin-bottom: 8px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 4px; }
.cal-month { min-width: 0; }
.cal-dow { text-align: center; font-size: .82rem; color: var(--muted); padding-bottom: 4px; }

.day {
  position: relative;
  aspect-ratio: 1 / 1; min-height: 40px; min-width: 0; padding: 0;
  border: 0; background: transparent; cursor: pointer;
  font-size: 1rem; color: var(--ink);
  display: grid; place-items: center;
}
.day span { position: relative; z-index: 1; width: min(40px, 100%); height: min(40px, 100%); display: grid; place-items: center; border-radius: 50%; }
.day:hover:not(:disabled) span { background: var(--sand); }
.day:disabled { cursor: default; color: #A9AE9F; }
/* Fully booked nights: crossed through with a hand-drawn stroke. */
.day.is-full { color: #9AA08F; }
.day.is-full span::after {
  content: ''; position: absolute; inset: 9px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M3 18.5C7 14 12 9 19 3.5' fill='none' stroke='%23B5592F' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .8;
}
.day.in-range::before {
  content: ''; position: absolute; inset: 4px 0; background: var(--sage-soft);
}
.day.is-start::before { left: 50%; }
.day.is-end::before { right: 50%; }
.day.is-start.is-end::before { display: none; }
.day.is-start span, .day.is-end span { background: var(--forest) !important; color: var(--paper); }
.day.is-today span { box-shadow: inset 0 0 0 1px var(--sage); }

.cal-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: .9rem; color: var(--muted); }
.cal-legend i { display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }
.cal-legend .lg-full { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M3 18.5C7 14 12 9 19 3.5' fill='none' stroke='%23B5592F' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.cal-legend .lg-sel { background: var(--forest); border-radius: 50%; }

/* ---------- Guests stepper ---------- */

.stepper { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--sand-line); border-radius: 999px; padding: 4px; background: var(--paper); }
.stepper output { min-width: 2.6em; text-align: center; font-family: var(--display); font-size: 1.2rem; color: var(--forest); }
.stepper .icon-btn { border: 0; background: var(--paper-deep); }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.field-row .label { font-size: 1.05rem; }
.field-row .sub { display: block; font-size: .92rem; color: var(--muted); }

/* ---------- Choice lists (rooms, batches) ---------- */

.choices { display: grid; gap: 14px; }
.choice {
  position: relative;
  display: grid; grid-template-columns: 104px 1fr; gap: 14px;
  padding: 12px; text-align: left; width: 100%;
  background: var(--paper); cursor: pointer;
  border: 1px solid var(--sand); border-radius: var(--radius-m);
  transition: border-color .15s ease, background-color .15s ease;
}
.choice:hover:not(:disabled) { border-color: var(--sage); }
.choice[aria-checked='true'] { border-color: var(--forest); background: #FFFDF9; box-shadow: inset 0 0 0 1px var(--forest); }
.choice:disabled { cursor: default; }
.choice:disabled .choice-body { opacity: .55; }
.choice img { width: 104px; height: 104px; object-fit: cover; border-radius: 10px; }
.choice h3 { font-size: 1.25rem; }
.choice p { margin: 4px 0 0; font-size: 1rem; color: var(--muted); line-height: 1.45; }
.choice .price { margin-top: 8px; color: var(--forest); font-size: 1rem; }
.choice .price strong { font-family: var(--display); font-weight: 400; font-size: 1.2rem; }
.choice .flag { display: inline-block; margin-top: 8px; font-size: .9rem; color: var(--muted); }
.choice .flag.low { color: var(--laterite); }
.choice .tick {
  position: absolute; top: 12px; right: 12px;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--sand-line); background: var(--paper);
  display: grid; place-items: center;
}
.choice[aria-checked='true'] .tick { background: var(--forest); border-color: var(--forest); }
.choice[aria-checked='true'] .tick::after { content: ''; width: 10px; height: 6px; border: 2px solid var(--paper); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
@media (min-width: 680px) { .choice { grid-template-columns: 150px 1fr; gap: 20px; } .choice img { width: 150px; height: 120px; } }

.batch { grid-template-columns: 76px 1fr; }
.batch .date-block {
  width: 76px; height: 86px; border-radius: 10px;
  background: var(--paper-deep); border: 1px solid var(--sand);
  display: grid; place-content: center; text-align: center; color: var(--forest);
  line-height: 1.1;
}
.batch .date-block b { font-family: var(--display); font-weight: 400; font-size: 1.9rem; }
.batch .date-block small { font-size: .9rem; }
.seats { display: flex; gap: 3px; margin-top: 10px; flex-wrap: wrap; }
.seats i { width: 9px; height: 9px; border-radius: 50%; background: var(--sage); }
.seats i.taken { background: transparent; box-shadow: inset 0 0 0 1px var(--sand-line); }

.empty {
  padding: 20px; border: 1px dashed var(--sand-line); border-radius: var(--radius-m);
  color: var(--muted); background: var(--paper-deep);
}

/* ---------- Form ---------- */

.form { display: grid; gap: 16px; }
@media (min-width: 680px) { .form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } }
.form .two { display: grid; gap: 16px; }
.field label { display: block; margin-bottom: 4px; font-size: 1rem; color: var(--forest); }
.field .opt { color: var(--muted); font-size: .92rem; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--sand-line); border-radius: var(--radius-s);
  background: #FFFDF9; font-size: 1.05rem;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px var(--sage-soft); }
.field .help { font-size: .9rem; color: var(--muted); margin-top: 4px; }

/* ---------- Summary ---------- */

.summary {
  background: var(--forest); color: #E9EDE2;
  border-radius: var(--radius-m);
  padding: 24px;
}
.summary h2 { color: var(--paper); font-size: 1.4rem; margin-bottom: 12px; }
.summary dl { margin: 0; display: grid; gap: 10px; }
.summary dl div { display: flex; justify-content: space-between; gap: 16px; font-size: 1rem; }
.summary dt { color: #B9C2AE; }
.summary dd { margin: 0; text-align: right; color: var(--paper); }
.summary .total { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(253, 249, 243, .2); display: flex; justify-content: space-between; align-items: baseline; }
.summary .total span { color: #B9C2AE; }
.summary .total strong { font-family: var(--display); font-weight: 400; font-size: 2rem; color: var(--paper); }
.summary .fine { font-size: .9rem; color: #B9C2AE; margin: 12px 0 0; }
.summary .policy { margin-top: 18px; font-size: .92rem; color: #B9C2AE; }
.summary .policy summary { cursor: pointer; color: var(--paper); }
.summary .policy p { margin: 8px 0 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 54px; padding: 12px 20px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--laterite); color: #fff;
  font-family: var(--display); font-size: 1.15rem; letter-spacing: .01em;
  transition: background-color .15s ease;
}
.btn:hover:not(:disabled) { background: var(--laterite-hover); }
.btn:disabled { background: #8D9384; cursor: not-allowed; }
.btn { text-decoration: none; }
.btn.secondary { background: transparent; color: var(--forest); box-shadow: inset 0 0 0 1px var(--forest); }
.btn .spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.summary .btn { margin-top: 20px; }
.secure { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 10px; font-size: .85rem; color: #B9C2AE; }

.error {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-s);
  background: var(--laterite-soft); color: var(--danger); font-size: 1rem;
}
.summary .error { background: rgba(245, 226, 214, .95); }

aside.side { display: none; }
.summary-inline { margin-top: 28px; }
@media (min-width: 960px) { .summary-inline { display: none; } }
@media (min-width: 960px) {
  aside.side { display: block; }
  aside.side .summary { position: sticky; top: 24px; }
}

/* Mobile pay bar */
.paybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--forest); color: var(--paper);
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 -8px 24px rgba(11, 45, 13, .18);
}
.paybar .pb-text { flex: 1; min-width: 0; line-height: 1.25; }
.paybar .pb-text small { display: block; color: #B9C2AE; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paybar .pb-text strong { font-family: var(--display); font-weight: 400; font-size: 1.45rem; }
.paybar .btn { width: auto; min-height: 48px; padding: 10px 22px; flex: none; }
@media (min-width: 960px) { .paybar { display: none; } }

/* ---------- Confirmation ---------- */

.done {
  max-width: 720px; margin: 0 auto; padding: 40px var(--gutter) 80px;
}
.done .mark { width: 120px; margin-bottom: 20px; opacity: .9; }
.done h1 { font-size: clamp(2rem, 6vw, 3rem); }
.done .lead { font-size: 1.2rem; margin: 12px 0 28px; }
.done .ticket {
  border: 1px solid var(--sand); border-radius: var(--radius-m); background: #FFFDF9;
  padding: 8px 20px;
}
.done .ticket div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--sand); }
.done .ticket div:first-child { border-top: 0; }
.done .ticket dt { color: var(--muted); }
.done .ticket dd { margin: 0; text-align: right; color: var(--forest); }
.done .ref { font-family: var(--display); font-size: 1.3rem; letter-spacing: .04em; }
.done .next { margin-top: 28px; display: grid; gap: 12px; }
.done .next p { margin: 0; }
.done .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.done .actions .btn { width: auto; }

.site-footer { border-top: 1px solid var(--sand); padding: 24px var(--gutter) 120px; text-align: center; font-size: .95rem; color: var(--muted); }
.site-footer a { color: var(--muted); }
@media (min-width: 960px) { .site-footer { padding-bottom: 32px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- The dorm ---------- */

.room-intro { padding: 28px 0 12px; }
.room-intro h2 { font-size: 1.9rem; }
.room-intro .lede { margin: 6px 0 16px; max-width: 40em; }

/* Phones: swipeable carousel, next photo peeks in from the right. */
.gallery-wrap { position: relative; }
.gallery {
  display: flex; gap: 10px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter);
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.tile {
  position: relative; flex: 0 0 86%;
  padding: 0; border: 0; background: var(--sand); cursor: zoom-in;
  border-radius: 12px; overflow: hidden; scroll-snap-align: start;
  aspect-ratio: 4 / 3;
}
.tile img { width: 100%; height: 100%; object-fit: cover; }
.counter {
  position: absolute; right: 10px; bottom: 10px;
  padding: 2px 10px; border-radius: 999px;
  background: rgba(11, 45, 13, .72); color: var(--paper); font-size: .85rem;
}
.tile .more {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(11, 45, 13, .55); color: var(--paper);
  font-family: var(--display); font-size: 1.2rem;
}

/* Tablets and up: a mosaic of five photos, first one large. */
@media (min-width: 760px) {
  .gallery {
    display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px;
    margin: 0; padding: 0; overflow: visible; height: 340px;
  }
  .tile { aspect-ratio: auto; border-radius: 8px; }
  .tile:first-child { grid-row: span 2; border-radius: 12px 8px 8px 12px; }
  .tile.extra { display: none; }
  .tile:hover img { transform: scale(1.03); }
  .tile img { transition: transform .4s ease; }
  .counter { display: none; }
}
@media (max-width: 759px) { .tile .more { display: none; } }

.facts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  margin: 18px 0 0; background: var(--sand);
  border: 1px solid var(--sand); border-radius: 12px; overflow: hidden;
}
.facts div { background: var(--paper); padding: 12px 14px; display: flex; flex-direction: column-reverse; }
.facts dt { font-size: .9rem; color: var(--muted); }
.facts dd { margin: 0; font-family: var(--display); font-size: 1.25rem; color: var(--forest); line-height: 1.25; }
@media (min-width: 760px) { .facts { grid-template-columns: repeat(4, 1fr); } }

.features { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px 24px; }
@media (min-width: 680px) { .features { grid-template-columns: 1fr 1fr; } }
.features li { position: relative; padding-left: 22px; font-size: 1rem; }
.features li::before { content: ''; position: absolute; left: 2px; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--sage); }

/* Full-screen photo viewer */
.viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: #0E140E; color: var(--paper);
}
.viewer::backdrop { background: rgba(0, 0, 0, .8); }
.viewer[open] { display: flex; flex-direction: column; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px var(--gutter); padding-top: calc(10px + env(safe-area-inset-top)); }
.viewer-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.viewer-track::-webkit-scrollbar { display: none; }
.viewer-track figure { flex: 0 0 100%; margin: 0; scroll-snap-align: center; display: flex; flex-direction: column; justify-content: center; padding: 0 0 calc(16px + env(safe-area-inset-bottom)); }
.viewer-track img { width: 100%; max-height: calc(100dvh - 140px); object-fit: contain; }
.viewer-track figcaption { padding: 12px var(--gutter) 0; font-size: .95rem; color: #C9D0BF; text-align: center; }
.viewer-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(253, 249, 243, .12); color: var(--paper); display: grid; place-items: center;
}
.viewer-btn svg { width: 20px; height: 20px; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); display: none; }
.viewer-nav.prev { left: 16px; }
.viewer-nav.next { right: 16px; }
@media (min-width: 760px) and (hover: hover) { .viewer-nav { display: grid; } }

/* Beds left under a calendar date */
.day small {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: -3px;
  font-size: .72rem; line-height: 1; color: var(--laterite); text-align: center; font-weight: 700;
}
.cal-grid { row-gap: 10px; }
.day.is-start small, .day.is-end small { color: var(--forest); }
.cal-legend .lg-left { font-style: normal; font-size: .72rem; color: var(--laterite); width: auto; height: auto; }
