/* What every page of the site shares: the reset, type, buttons, form fields, messages and the small parts both
   the booking page and the owner's pages show (an amount with its currency, a week of the calendar, a tick box).
   A page loads this sheet and then its own (style.css, admin.css), whose rules come later and so win a tie.
   Every value is a token of tokens.css; text colours are the pairs of design-system/palmora/pairs.json. Layout
   uses logical properties, so Arabic needs no second stylesheet. */

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  /* biome-ignore lint/complexity/noImportantStyles: many elements set their own display, so the hidden attribute must win over them */
  display: none !important;
}
body {
  margin: 0;
  background: var(--color-sand);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}
img,
video {
  display: block;
  max-inline-size: 100%;
}
img {
  block-size: auto;
}
h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--leading-tight);
  text-wrap: balance;
}
/* Headings that wrap need more room than the one-line name. */
h2,
h3 {
  line-height: var(--leading-heading);
}
h2 {
  font-size: var(--text-2xl);
}
h3 {
  font-size: var(--text-lg);
}
/* Wrapped Naskh needs room. */
html[lang="ar"] :is(h2, h3) {
  line-height: var(--leading-body);
}
p,
figure,
dl,
dd {
  margin: 0;
}
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
fieldset {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
legend {
  padding: 0;
}
table {
  border-collapse: collapse;
}
button,
input,
select,
textarea {
  color: inherit;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}
a {
  color: var(--color-pool);
}
:focus-visible {
  outline: 2px solid var(--color-pool);
  outline-offset: 2px;
}
.dark :focus-visible {
  outline-color: var(--color-cream);
}

/* Screen readers only. */
.vh {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.icon {
  flex: none;
  inline-size: var(--text-lg);
  block-size: var(--text-lg);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Pointing icons mirror in Arabic. */
html[dir="rtl"] .flip {
  transform: scaleX(-1);
}
/* The language switch shows only the other language. */
html[lang="ar"] [data-only="en"],
html[lang="en"] [data-only="ar"] {
  display: none;
}
.wrap {
  inline-size: min(100% - var(--space-8), var(--size-page));
  margin-inline: auto;
}
.head {
  display: grid;
  gap: var(--space-2);
  max-inline-size: var(--size-measure);
  margin-block-end: var(--space-8);
}
.label,
.hint,
.wd,
.legend {
  color: var(--color-stone);
  font-size: var(--text-sm);
}
.dark {
  background: var(--color-night);
  color: var(--color-cream);
}
.dark .label {
  color: var(--color-gold);
}
.dark .hint {
  color: var(--color-mist);
}
.row,
.legend li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* Controls: at least --size-tap high, with a visible focus ring. */
.btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-block-size: var(--size-tap);
  padding: var(--space-2) var(--space-6);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: 700;
  line-height: var(--leading-tight);
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--motion-fast) var(--motion-ease);
}
.btn:active,
.icon-btn:active:enabled {
  transform: scale(0.96);
}
.btn-primary {
  background: var(--color-palm);
  color: var(--color-surface);
}
.btn-ghost {
  border-color: var(--color-mist);
  color: var(--color-cream);
}
/* An icon button keeps its 44 px in a row whose text grows: it never shrinks. */
.icon-btn {
  flex: none;
  inline-size: var(--size-tap);
  padding: 0;
  color: var(--color-ink);
}

/* Surfaces with a hairline: fields, secondary controls, tick boxes. */
.btn-secondary,
.icon-btn,
.check,
.input {
  border: 1px solid var(--color-line);
  background: var(--color-surface);
}
.btn-secondary {
  color: var(--color-palm);
}
.btn-primary:disabled,
.icon-btn:disabled {
  background: var(--color-stone-soft);
  color: var(--color-stone);
  cursor: not-allowed;
}
@media (hover: hover) {
  .btn-secondary:hover,
  button.icon-btn:hover:enabled {
    background: var(--color-palm-soft);
  }
}

/* A list of terms and their values. */
.kv {
  display: grid;
  gap: var(--space-2);
}
.kv div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
}
.kv dd {
  font-weight: 700;
}

/* Amounts. The normal rate an offer replaced is struck through. */
.was {
  color: var(--color-stone);
  font-size: var(--text-sm);
  font-weight: 400;
}
.dark .was {
  color: var(--color-mist);
}
.money {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-1);
}
/* The strike is set on the amount itself: a decoration does not reach inside an inline flex box. */
.was s,
.was .money {
  text-decoration: line-through;
}
.cur {
  font-family: var(--font-body);
  font-size: var(--text-sm);
}
.dark .cur {
  color: var(--color-mist);
}
/* "OMR 140" in English, "140 ر.ع." in Arabic, from the same markup. */
html[lang="en"] .cur {
  order: -1;
}

/* A calendar's week: seven columns from Sunday. Days at the weekend rate carry an amber dot. */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-1);
}
.wd {
  padding-block: var(--space-1);
  text-align: center;
}
.is-weekend::after,
.dot {
  content: "";
  display: block;
  inline-size: var(--space-2);
  block-size: var(--space-2);
  margin: var(--space-1) auto 0;
  border-radius: var(--radius-pill);
  background: var(--color-amber);
}
.dot {
  margin: 0;
}
[aria-pressed="true"].is-weekend::after {
  background: currentColor;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}

/* Tick boxes and radio buttons, and a row that holds one with its words and its price. */
input[type="radio"],
input[type="checkbox"] {
  flex: none;
  inline-size: var(--text-lg);
  block-size: var(--text-lg);
  margin: 0;
  accent-color: var(--color-pool);
}
.check:has(:checked) {
  border-color: var(--color-pool);
  background: var(--color-pool-soft);
  box-shadow: inset 0 0 0 1px var(--color-pool);
}
/* Stone and palm on pool-soft are not pairs; ink is. */
.check:has(:checked) :is(.hint, .price, .was) {
  color: var(--color-ink);
}
.price {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--space-2);
  color: var(--color-palm);
  font-weight: 700;
}
.price .money {
  white-space: nowrap;
}
.check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-block-size: var(--size-tap);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.check .price {
  margin-inline-start: auto;
  white-space: nowrap;
}
.checks {
  display: grid;
  gap: var(--space-2);
}
/* The tick box of a service, beside its name: on the booking page's cards and in the owner's form. */
.org-pick,
.svc-pick {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-block-size: var(--size-tap);
  cursor: pointer;
}
.addons legend,
.field > legend {
  margin-block-end: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 700;
}

/* Fields */
.fields {
  display: grid;
  gap: var(--space-4);
}
.field {
  display: grid;
  gap: var(--space-1);
}
.field > label {
  font-size: var(--text-sm);
  font-weight: 700;
}
.input {
  inline-size: 100%;
  min-block-size: var(--size-tap);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--color-ink);
}
.input[aria-invalid="true"] {
  border-color: var(--color-danger);
}
/* In Arabic, a number typed left to right ends at the same edge as the Arabic labels. */
html[dir="rtl"] .input[dir="ltr"] {
  text-align: end;
}

/* Messages. A refusal stands under its field in danger on its soft ground, in words; a note is information. A
   message may quote an address, one long word: it breaks anywhere rather than widen the page. */
.msg {
  justify-self: start;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}
.msg.is-error {
  background: var(--color-danger-soft);
  color: var(--color-danger);
  font-weight: 700;
}
.note {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-pool-soft);
  color: var(--color-ink);
}
/* A note with an icon and a heading of its own. */
.note-box {
  display: flex;
  align-items: start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-pool-soft);
}
.note-box .icon,
.note-box strong {
  color: var(--color-pool);
}
.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  min-block-size: var(--size-tap);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-danger-soft);
  color: var(--color-ink);
}
.notice > .icon,
.notice strong {
  color: var(--color-danger);
}
.note-box strong,
.notice strong {
  display: block;
}
.notice > :is(p, div) {
  flex: 1 1 calc(var(--space-24) + var(--space-18));
}

/* The logo standing alone: at least --size-tap high wherever its ring shows; never recoloured or stretched. */
.logo {
  inline-size: var(--space-18);
  block-size: var(--space-18);
}

/* Skeleton blocks: the shape of what is on its way, while a page's data loads. `:root` lifts the rule over the
   surfaces of a page's own sheet (a card, a tile), which loads after this one. */
:root .skel {
  border-color: transparent;
  background: var(--color-stone-soft);
  box-shadow: none;
  animation: wait var(--motion-slow) var(--motion-ease) infinite alternate;
}
@keyframes wait {
  to {
    opacity: var(--opacity-scrim);
  }
}
.skel-calendar {
  aspect-ratio: 7 / 6;
  border-radius: var(--radius-md);
}
.skel-card {
  min-block-size: calc(var(--space-24) * 2);
}
@media (prefers-reduced-motion: reduce) {
  :root .skel {
    animation: none;
  }
}

@media (min-width: 768px) {
  .wrap {
    inline-size: min(100% - var(--space-12), var(--size-page));
  }
}
