/* ------------------------------------------------------------------ *
 * Golden Rose – public site (the homepage at "/")
 *
 * Loaded after style.css and depends on its brand tokens (--brand,
 * --brand-tint, --surface, --page-bg, the --sidebar-* gradient stops), so the
 * public page and the admin app re-skin together from one place.
 *
 * Written with CSS logical properties throughout: Arabic is the default
 * language, so RTL is the primary direction rather than an afterthought.
 * ------------------------------------------------------------------ */

.public-shell {
  background-color: var(--page-bg);
}

/* ------------------------------------------------------------------ *
 * Header
 * ------------------------------------------------------------------ */

.public-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 1030;
  background-color: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-block-end: 1px solid var(--bs-border-color);
}

@supports not (background-color: color-mix(in srgb, red 50%, transparent)) {
  .public-header { background-color: var(--surface); }
}

.public-nav {
  padding-block: 0.6rem;
}

.public-brand {
  color: var(--brand);
  font-size: 1.0625rem;
}

.public-brand:hover,
.public-brand:focus {
  color: var(--brand);
}

.public-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 0.65rem;
  background: var(--brand-btn);
  color: var(--brand-btn-fg);
  font-size: 1.05rem;
  flex: 0 0 auto;
}

.public-nav .nav-link {
  color: var(--bs-body-color);
  font-weight: 500;
  border-radius: 0.5rem;
  padding-inline: 0.75rem;
}

.public-nav .nav-link:hover,
.public-nav .nav-link:focus-visible {
  color: var(--brand);
  background-color: var(--brand-tint);
}

.public-staff-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ *
 * Hero
 * ------------------------------------------------------------------ */

.public-hero {
  /* .bg-brand supplies the gradient; it is a dark surface in both colour
   * modes, so the text on it is fixed white rather than token-driven. */
  color: #fff;
  padding-block: clamp(3.5rem, 9vw, 6.5rem);
  text-align: center;
}

.public-hero-title {
  font-size: clamp(1.85rem, 5.2vw, 3rem);
  font-weight: 700;
  line-height: 1.25;
  margin-block-end: 1rem;
  text-wrap: balance;
}

.public-hero-lead {
  font-size: clamp(1rem, 2.1vw, 1.1875rem);
  line-height: 1.7;
  /* Slightly transparent rather than a grey: it has to sit on a gradient. */
  color: rgba(255, 255, 255, 0.85);
  max-width: 44rem;
  margin-inline: auto;
  margin-block-end: 2rem;
}

/* Location pill in the hero. Translucent white rather than a solid fill so it
 * reads as part of the gradient instead of a card dropped on top of it. */
.hero-place {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-block: 0 2rem;
  padding: 0.4rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: clamp(0.9rem, 1.7vw, 1rem);
  font-weight: 500;
  text-decoration: none;
  /* Arabic and Latin place names both sit on this line; keep the pin next to
   * the text in either direction rather than pinned to a physical side. */
  text-align: start;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.hero-place .bi-geo-alt-fill {
  font-size: 1.1em;
  line-height: 1;
}

.hero-place-out {
  font-size: 0.8em;
  opacity: 0.75;
}

a.hero-place:hover,
a.hero-place:focus-visible {
  background-color: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}

.public-hero .btn-outline-light:hover {
  color: var(--sidebar-to);
}

/* --- derived figures under the hero -------------------------------- */

.public-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-block: 3rem 0;
}

.public-stat {
  /* dt (the label) comes first in the DOM so the pair reads correctly to a
   * screen reader; the value is lifted above it visually. */
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.15rem;
  min-width: 9.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.85rem;
  background-color: rgba(255, 255, 255, 0.08);
}

.public-stat dt {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
}

.public-stat dd {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

/* ------------------------------------------------------------------ *
 * Sections
 * ------------------------------------------------------------------ */

.public-section {
  padding-block: clamp(2.75rem, 6vw, 4.5rem);
  /* Anchor links land below the sticky header rather than under it. */
  scroll-margin-block-start: 4.5rem;
}

.public-section-alt {
  background-color: var(--surface);
}

.public-section-head {
  max-width: 42rem;
  margin-block-end: 2rem;
}

.public-section-head h2 {
  color: var(--brand);
  font-size: clamp(1.4rem, 3.2vw, 1.875rem);
  font-weight: 700;
  margin-block-end: 0.5rem;
}

.public-section-head p {
  color: var(--bs-secondary-color);
  margin-block-end: 0;
}

/* ------------------------------------------------------------------ *
 * "What's included" / contact cards
 * ------------------------------------------------------------------ */

.include-icon {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background-color: var(--brand-tint);
  color: var(--brand);
  font-size: 1.2rem;
}

.include-card,
.contact-card {
  border-radius: 0.85rem;
}

.contact-card {
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

a.contact-card:hover,
a.contact-card:focus-visible {
  color: inherit;
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12) !important;
}

/* ------------------------------------------------------------------ *
 * Chalet cards
 * ------------------------------------------------------------------ */

.chalet-card {
  border-radius: 0.85rem;
  overflow: hidden;
}

.chalet-photo {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background-color: var(--brand-tint);
}

/* Fallback panel when an apartment has no image on file. Tinted with that
 * unit's own calendar colour so the grid keeps its rhythm. */
.chalet-photo-empty {
  display: grid;
  place-items: center;
  font-size: 2.25rem;
  color: var(--unit-color, var(--brand));
  background-color: color-mix(in srgb, var(--unit-color, var(--brand)) 12%, transparent);
}

@supports not (background-color: color-mix(in srgb, red 50%, transparent)) {
  .chalet-photo-empty { background-color: var(--brand-tint); }
}

/* The photo doubles as the link to the detail page. */
.chalet-photo-link {
  position: relative;
  display: block;
}

.chalet-badge {
  position: absolute;
  inset-block-start: 0.6rem;
  inset-inline-end: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.chalet-name-link {
  color: inherit;
  text-decoration: none;
}

.chalet-name-link:hover,
.chalet-name-link:focus-visible {
  color: var(--brand);
  text-decoration: underline;
}

/* A chalet that is booked for the searched dates: still readable, visibly
 * de-emphasised. Opacity alone would fail contrast, so only the photo dims. */
.chalet-card-taken .chalet-photo {
  filter: grayscale(0.75);
  opacity: 0.75;
}

/* Clamp so five cards keep a common height regardless of how much staff wrote. */
.chalet-summary {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ------------------------------------------------------------------ *
 * Chalet detail page
 * ------------------------------------------------------------------ */

.chalet-back {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}

.chalet-back:hover { text-decoration: underline; }

.chalet-title { color: var(--brand); }

.chalet-hero-photo {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background-color: var(--brand-tint);
}

.chalet-carousel .carousel-inner {
  border-radius: 0.85rem;
  overflow: hidden;
}

/* Bootstrap's controls are white-on-image; add a scrim so they stay visible
 * against a pale photograph. */
.chalet-carousel .carousel-control-prev,
.chalet-carousel .carousel-control-next {
  width: 12%;
}

.chalet-carousel .carousel-control-prev-icon,
.chalet-carousel .carousel-control-next-icon {
  background-color: rgba(0, 0, 0, 0.45);
  border-radius: 50%;
  padding: 1rem;
  background-size: 45%;
}

.chalet-thumbs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-block-end: 0.25rem;
}

.chalet-thumb {
  flex: 0 0 auto;
  width: 4.5rem;
  height: 3.25rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  overflow: hidden;
  background: none;
  cursor: pointer;
}

.chalet-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chalet-thumb:hover,
.chalet-thumb:focus-visible {
  border-color: var(--brand);
  outline: none;
}

.chalet-description { white-space: pre-line; }

/* ------------------------------------------------------------------ *
 * Availability search
 * ------------------------------------------------------------------ */

.avail-form { border-radius: 0.85rem; }

/* Give the native date picker room in both directions. */
.avail-form input[type="date"] { min-height: 2.75rem; }

.chalet-price-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand);
}

.chalet-amenities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-block-end: 0;
}

.chalet-amenities li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 999px;
  font-size: 0.8125rem;
  color: var(--bs-secondary-color);
}

.chalet-amenities li i {
  color: var(--brand);
  font-size: 0.875rem;
}

.chalet-amenities-more {
  border-style: dashed !important;
}

/* ------------------------------------------------------------------ *
 * Footer
 * ------------------------------------------------------------------ */

.public-footer {
  padding-block: 1.5rem;
  background-color: var(--surface);
  border-block-start: 1px solid var(--bs-border-color);
}

/* ------------------------------------------------------------------ *
 * Motion
 * ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .contact-card { transition: none; }
  a.contact-card:hover,
  a.contact-card:focus-visible { transform: none; }
  html { scroll-behavior: auto; }
}
