/* ==========================================================================
   Hammam Sables d’Or — Layout: container, section rhythm, header, footer

   Specificity note: every rule here is a single class (0,1,0). Modifiers are
   declared immediately after the block they modify so cascade order — not
   specificity escalation — decides the winner. Do not add element selectors.
   ========================================================================== */

/* ---- Container ----------------------------------------------------------- */

.ht-wrap {
  width: 100%;
  max-width: var(--ht-max);
  margin-inline: auto;
  padding-inline: var(--ht-gutter);
}

.ht-wrap--narrow {
  max-width: 860px;
}

.ht-wrap--wide {
  max-width: 1560px;
}

/* ---- Section rhythm ------------------------------------------------------ */

.ht-section {
  padding-block: var(--ht-section);
  position: relative;
}

.ht-section--tight {
  padding-block: calc(var(--ht-section) * 0.58);
}

.ht-section--top-flush {
  padding-block-start: 0;
}

.ht-section--bottom-flush {
  padding-block-end: 0;
}

.ht-section--surface {
  background: var(--ht-surface);
}

/* Section header: eyebrow + title + optional lead, used on every band. */

.ht-shead {
  display: flex;
  flex-direction: column;
  gap: var(--ht-s-3);
  margin-block-end: var(--ht-s-6);
  max-width: var(--ht-measure);
}

.ht-shead--center {
  align-items: center;
  text-align: center;
  margin-inline: auto;
}

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

.ht-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: var(--ht-z-header);
  height: var(--ht-header-h);
  display: flex;
  align-items: center;
  background: transparent;
  border-block-end: 1px solid transparent;
  transition: background var(--ht-dur-fast) var(--ht-ease),
    border-color var(--ht-dur-fast) var(--ht-ease),
    backdrop-filter var(--ht-dur-fast) var(--ht-ease);
}

.ht-header.is-scrolled {
  background: rgb(11 10 8 / 0.86);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-block-end-color: var(--ht-line);
}

.ht-header__inner {
  width: 100%;
  max-width: var(--ht-max);
  margin-inline: auto;
  padding-inline: var(--ht-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ht-s-4);
}

/* The wordmark is now the supplied lockup rather than set text.

   display: block matters: an inline <img> sits on the text baseline and
   reserves descender space under it, which reads as the logo hanging a few
   pixels high in a flex row that is otherwise perfectly centred. */
.ht-brand {
  display: block;
  line-height: 0;
  text-decoration: none;
}

/* Two lockups, because one cannot do both jobs.

   The supplied Sables d'Or artwork is a near-SQUARE stacked lockup on its own
   dark halo. The halo is keyed out so it sits on --ht-ground without showing a
   rectangle, and the square proportion is why the header cannot use it: at the
   76px header's 52px ceiling it would be 58px wide, with the wordmark illegible.

   So the header gets logo-sables-dor-h.png (horizontal: symbol left, name right,
   tagline dropped) and the footer keeps logo-sables-dor-v.png, the full stacked
   mark including the tagline. Both are derived from the supplied artwork — see
   assets/README-logo.md. */
.ht-brand__logo {
  display: block;
  width: auto;
  height: var(--brand-h, 3.25rem);
  transition: opacity var(--ht-dur-fast) var(--ht-ease);
}

.ht-brand:hover .ht-brand__logo {
  opacity: 0.82;
}

/* The footer has room to give the lockup its full presence.

   Two selectors because the two builds name the footer differently: the static
   site has <footer class="ht-footer">, while on WordPress the footer is an
   Elementor template that carries none of our classes — .ht-footer alone would
   silently leave the footer lockup at the header's 3.25rem there. .ht-footer__brand
   is the class on the footer's brand widget, which both builds do share. */
/* The footer carries the stacked mark, and its height is set by the artwork's
   proportion rather than copied from the header. At 1.12:1 the old 5.5rem gave
   a 99px-wide block whose wordmark was unreadable; the previous brand's lockup
   was 2.9:1, where the same height gave 255px. 9.375rem lands ~168px wide in a
   331px column, with "SABLES D'OR" at about 25px. */
.ht-footer .ht-brand__logo,
.ht-footer__brand .ht-brand__logo {
  --brand-h: 9.375rem;
}

@media (max-width: 640px) {
  .ht-brand__logo {
    --brand-h: 2.75rem;
  }

  .ht-footer .ht-brand__logo,
  .ht-footer__brand .ht-brand__logo {
    --brand-h: 7rem;
  }
}

.ht-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2.4vw, 2.5rem);
}

.ht-nav__link {
  font-size: var(--ht-t-sm);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ht-steam);
  text-decoration: none;
  padding-block: 0.4rem;
  position: relative;
  white-space: nowrap;
}

.ht-nav__link::after {
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 0;
  width: 100%;
  height: 1px;
  background: var(--ht-brass);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--ht-dur-fast) var(--ht-ease);
}

.ht-nav__link:hover::after,
.ht-nav__link[aria-current="page"]::after {
  transform: scaleX(1);
}

.ht-nav__link[aria-current="page"] {
  color: var(--ht-brass);
}

.ht-header__actions {
  display: flex;
  align-items: center;
  gap: var(--ht-s-2);
}

/* Mobile menu toggle — two rules that become an X. */

.ht-burger {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  position: relative;
}

.ht-burger__bar {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--ht-steam);
  position: absolute;
  top: 50%;
  left: 50%;
  transition: transform var(--ht-dur-fast) var(--ht-ease);
}

/* The first child of .ht-burger is the visually-hidden label, so the two
   rules are children 2 and 3. Both are centred on the button first, then
   offset — otherwise the open state rotates around the wrong point and the
   cross comes out crooked. */
.ht-burger__bar:nth-child(2) {
  transform: translate(-50%, -50%) translateY(-4px);
}
.ht-burger__bar:nth-child(3) {
  transform: translate(-50%, -50%) translateY(4px);
}

.ht-burger[aria-expanded="true"] .ht-burger__bar:nth-child(2) {
  transform: translate(-50%, -50%) rotate(45deg);
}
.ht-burger[aria-expanded="true"] .ht-burger__bar:nth-child(3) {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* ---- Mobile navigation panel --------------------------------------------- */

.ht-mobilenav {
  position: fixed;
  inset: 0;
  z-index: calc(var(--ht-z-header) - 1);
  background: var(--ht-ground-deep);
  padding: calc(var(--ht-header-h) + var(--ht-s-6)) var(--ht-gutter) var(--ht-s-6);
  display: flex;
  flex-direction: column;
  gap: var(--ht-s-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-1.5rem);
  transition: opacity var(--ht-dur-fast) var(--ht-ease),
    transform var(--ht-dur-fast) var(--ht-ease),
    visibility var(--ht-dur-fast) var(--ht-ease);
}

.ht-mobilenav.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ht-mobilenav__link {
  font-family: var(--ht-font-display);
  font-size: var(--ht-t-lg);
  color: var(--ht-steam);
  text-decoration: none;
  padding-block: var(--ht-s-2);
  border-block-end: 1px solid var(--ht-line);
}

.ht-mobilenav__link[aria-current="page"] {
  color: var(--ht-brass);
}

.ht-mobilenav__foot {
  margin-block-start: auto;
  padding-block-start: var(--ht-s-5);
  display: flex;
  flex-direction: column;
  gap: var(--ht-s-3);
}

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

.ht-footer {
  background: var(--ht-ground-deep);
  border-block-start: 1px solid var(--ht-line-brass);
  padding-block: var(--ht-s-7) var(--ht-s-4);
  font-size: var(--ht-t-sm);
  color: var(--ht-muted);
}

.ht-footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: var(--ht-s-6) var(--ht-s-5);
  padding-block-end: var(--ht-s-6);
}

.ht-footer__col {
  display: flex;
  flex-direction: column;
  gap: var(--ht-s-2);
}

.ht-footer__title {
  font-family: var(--ht-font-body);
  font-size: var(--ht-t-xs);
  font-weight: 500;
  letter-spacing: var(--ht-track-eyebrow);
  text-transform: uppercase;
  color: var(--ht-brass);
  margin-block-end: var(--ht-s-1);
}

.ht-footer__link {
  color: var(--ht-muted);
  text-decoration: none;
  width: fit-content;
}

.ht-footer__link:hover {
  color: var(--ht-brass);
}

.ht-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ht-s-2) var(--ht-s-4);
  align-items: center;
  justify-content: space-between;
  padding-block-start: var(--ht-s-4);
  border-block-start: 1px solid var(--ht-line);
  font-size: var(--ht-t-xs);
  color: var(--ht-muted);
}

.ht-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ht-s-3);
}

/* ---- Responsive ---------------------------------------------------------- */

@media (max-width: 1000px) {
  .ht-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .ht-nav,
  .ht-header__actions .ht-btn {
    display: none;
  }

  .ht-burger {
    display: grid;
  }
}

@media (max-width: 560px) {
  .ht-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--ht-s-5);
  }

  .ht-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
