/* Spirit of Kenya — mobile refinement layer */
h1 em,
h2 em {
  color: var(--red) !important;
}

.dark-section h1 em,
.dark-section h2 em {
  color: var(--red-bright) !important;
}

.header-inner {
  position: relative;
  z-index: 4;
}

.menu-button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.mobile-panel {
  z-index: 2 !important;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  pointer-events: none;
  transition: opacity .32s ease, visibility .32s ease, transform .42s cubic-bezier(.22, 1, .36, 1) !important;
}

.mobile-panel.is-open {
  pointer-events: auto;
}

.mobile-panel-inner {
  height: auto !important;
  min-height: calc(100dvh - 150px);
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}

html.sok-menu-open,
html.sok-menu-open body {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.site-header.is-menu-open,
.site-header:has(.menu-button.is-open) {
  background: var(--charcoal);
  color: var(--cream);
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: none;
}

.site-header.is-menu-open .brand img,
.site-header:has(.menu-button.is-open) .brand img {
  filter: brightness(0) invert(1) !important;
}

.site-header .brand {
  transition: width .3s ease, opacity .24s ease, transform .24s ease;
}

.mobile-about-group {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 0;
  padding: 17px 0 18px;
}

.mobile-about-group > p {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  margin: 0 0 9px;
  color: var(--cream);
  font-family: var(--display);
  font-size: 31px;
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1;
  text-transform: none;
}

.mobile-about-group > p::before {
  content: "06";
  position: static;
  align-self: start;
  padding-top: 3px;
  color: var(--sand);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .1em;
}

.mobile-about-group a {
  grid-column: 2;
  display: block;
  margin: 0;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.09);
  color: rgba(247,244,236,.82);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .09em;
  line-height: 1.25;
  text-transform: uppercase;
}

.mobile-about-group a:last-child {
  border-bottom: 0;
}

.mobile-about-group + a > span {
  color: transparent !important;
}

.mobile-about-group + a > span::after {
  content: "07";
  color: var(--sand);
}

.mobile-panel-inner > .button.button-cream,
.mobile-panel-inner > .mobile-plan-cta {
  position: relative;
  min-height: 74px;
  background: var(--red);
  color: #fff;
  font-size: 14px;
  letter-spacing: .14em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1), 0 18px 38px rgba(0,0,0,.22);
}

.mobile-panel-inner > .button.button-cream::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255,255,255,.16);
  pointer-events: none;
}

.mobile-panel-inner > .button.button-cream span,
.mobile-panel-inner > .mobile-plan-cta span {
  display: none !important;
}

.sok-mobile-plan-bar {
  display: none;
}

@media (max-width: 760px) {
  :root {
    --sok-mobile-header: 106px;
  }

  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  .site-header,
  .site-header.is-scrolled,
  .site-header.is-menu-open,
  .site-header:has(.menu-button.is-open) {
    height: var(--sok-mobile-header) !important;
  }

  .site-header.is-scrolled:not(.is-menu-open):not(:has(.menu-button.is-open)) {
    height: 96px !important;
  }

  .header-inner {
    width: calc(100% - 28px) !important;
    gap: 12px;
  }

  .brand,
  .site-header.is-scrolled .brand {
    width: min(184px, 55vw) !important;
  }

  .brand img {
    max-height: 80px !important;
  }

  .header-actions {
    gap: 10px;
  }

  .menu-button {
    display: flex !important;
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border-color: currentColor;
  }

  .menu-button span {
    width: 23px;
  }

  .header-actions .button {
    display: none;
  }

  .mobile-panel {
    inset: 0;
    padding: calc(var(--sok-mobile-header) + 18px) 22px max(34px, env(safe-area-inset-bottom));
    background:
      radial-gradient(circle at 88% 8%, rgba(181,38,45,.12), transparent 27%),
      var(--charcoal);
    transform: translateY(-14px);
  }

  .mobile-panel-inner {
    min-height: calc(100dvh - var(--sok-mobile-header) - 52px);
  }

  .mobile-panel-inner > .eyebrow {
    margin-bottom: 12px;
    color: rgba(247,244,236,.7);
    font-size: 10px;
  }

  .mobile-panel-inner > a:not(.button) {
    min-height: 58px;
    padding: 10px 0;
    display: flex;
    align-items: center;
    font-size: clamp(30px, 9vw, 38px);
    line-height: .95;
  }

  .mobile-about-group > p {
    min-height: 58px;
    align-items: center;
    margin-bottom: 7px;
    font-size: clamp(30px, 9vw, 38px);
    line-height: .95;
  }

  .mobile-about-group > p::before {
    align-self: center;
    padding-top: 0;
  }

  .mobile-panel-inner > a > span {
    width: 34px;
    flex: 0 0 34px;
    align-self: flex-start;
    padding-top: 2px;
  }

  .mobile-language-row {
    padding-top: 20px;
  }

  .mobile-language-row .language-switcher {
    min-height: 48px;
    padding: 5px 14px;
  }

  .mobile-language-row .language-switcher select {
    min-height: 38px;
    font-size: 13px;
  }

  .mobile-panel-inner > .button.button-cream,
  .mobile-panel-inner > .mobile-plan-cta {
    display: inline-flex;
    width: 100%;
    min-height: 76px;
    margin-top: 24px;
    font-size: 15px;
  }

  .mobile-contact {
    gap: 5px;
    margin-top: 30px;
    padding: 22px 0 6px;
    border-top: 1px solid rgba(255,255,255,.16);
    font-size: 14px;
    line-height: 1.5;
  }

  /* The key mobile pattern from /newc: a real fixed overlay, without iOS backdrop clipping. */
  .site-header.is-menu-open,
  .site-header:has(.menu-button.is-open) {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .site-header.is-menu-open::after,
  .site-header:has(.menu-button.is-open)::after {
    content: "";
    position: fixed;
    z-index: 3;
    inset: 0 0 auto;
    height: var(--sok-mobile-header);
    border-bottom: 1px solid rgba(255,255,255,.09);
    background: rgba(29,31,28,.98);
    pointer-events: none;
  }

  .site-header.is-menu-open .header-inner,
  .site-header:has(.menu-button.is-open) .header-inner {
    z-index: 4;
  }

  .site-header.is-mobile-menu-scrolled .brand {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
  }

  /* Give every page enough air below the larger navigation. */
  .page-hero,
  .contact-hero,
  .journal-hero,
  .article-hero,
  .gallery-hero {
    scroll-margin-top: var(--sok-mobile-header);
  }

  .faq-hero,
  .stays-hero,
  .stay-detail-hero {
    padding-top: calc(var(--sok-mobile-header) + 46px) !important;
  }

  /* Homepage hero becomes a composed mobile hero instead of a desktop crop plus loose blocks. */
  .brand-hero {
    height: min(820px, 88svh) !important;
    min-height: 690px !important;
    padding-top: 0 !important;
    overflow: hidden !important;
  }

  .brand-hero .hero-media {
    position: absolute !important;
    inset: 0 !important;
    aspect-ratio: auto !important;
  }

  .brand-hero .hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    object-position: 62% center !important;
  }

  .brand-hero::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    background: linear-gradient(180deg, rgba(12,14,12,.22) 0%, rgba(12,14,12,.05) 35%, rgba(12,14,12,.84) 100%);
    pointer-events: none;
  }

  .brand-hero-lockup {
    z-index: 2;
    top: calc(var(--sok-mobile-header) + 34px) !important;
    left: 22px !important;
    width: min(310px, 78vw) !important;
  }

  .brand-hero-actions {
    position: absolute !important;
    z-index: 2;
    inset: auto 20px 34px !important;
    padding: 0 !important;
    gap: 18px !important;
    background: transparent !important;
  }

  .brand-hero-actions > div:first-child {
    max-width: 330px;
  }

  .brand-hero-actions > div:first-child p:last-child {
    font-size: 14px;
    line-height: 1.55;
  }

  .brand-hero-actions > div:last-child {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .brand-hero-actions .home-film-trigger {
    grid-column: 1 / -1;
    min-height: 66px !important;
  }

  .brand-hero-actions .button {
    width: auto !important;
    min-width: 0;
    min-height: 62px;
    padding-inline: 12px;
    font-size: 10px;
  }

  .brand-hero-actions .text-link {
    min-height: 62px;
    padding: 0 8px 5px;
    justify-content: center;
    text-align: center;
    font-size: 9px;
  }

  .finder-wrap {
    width: calc(100% - 20px) !important;
    margin-top: -12px !important;
  }

  .finder-heading {
    min-height: 118px !important;
    padding: 22px !important;
  }

  .finder label {
    min-height: 104px !important;
  }

  .finder select,
  .form-grid input,
  .form-grid select,
  .form-grid textarea,
  button,
  .button {
    touch-action: manipulation;
  }

  .section-header {
    gap: 22px;
  }

  .section-header h2,
  .editorial-title h2 {
    font-size: clamp(48px, 14vw, 62px);
    line-height: .93;
  }

  /* Swipeable editorial rails are more natural on mobile than very long one-card columns. */
  .destination-rail,
  .featured-grid,
  .home-stays-grid,
  .home-journal-grid,
  .journal-grid {
    width: calc(100vw - 20px);
    margin-left: -10px;
    padding: 0 10px 18px;
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: min(84vw, 390px);
    grid-template-columns: none !important;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .destination-rail::-webkit-scrollbar,
  .featured-grid::-webkit-scrollbar,
  .home-stays-grid::-webkit-scrollbar,
  .home-journal-grid::-webkit-scrollbar,
  .journal-grid::-webkit-scrollbar {
    display: none;
  }

  .destination-rail > *,
  .featured-grid > *,
  .home-stays-grid > *,
  .home-journal-grid > *,
  .journal-grid > * {
    grid-column: auto !important;
    scroll-snap-align: start;
  }

  .destination-card {
    min-height: 510px !important;
  }

  .home-stay-card,
  .home-stay-card.wide,
  .stay-feature,
  .stay-feature.large {
    min-height: 510px !important;
  }

  .safari-card,
  .home-stay-card,
  .journal-card,
  .destination-card {
    transform: translateZ(0);
  }

  .review-proof {
    width: calc(100% - 24px) !important;
    margin-inline: auto;
    grid-template-columns: 1fr 1fr !important;
  }

  .review-proof > div {
    grid-column: 1 / -1 !important;
  }

  .review-proof > a {
    min-height: 145px !important;
    padding: 24px 18px !important;
  }

  .review-proof > a strong {
    font-size: 52px;
  }

  /* Persistent, thumb-friendly conversion affordance inspired by /newc. */
  .sok-mobile-plan-bar {
    position: fixed;
    z-index: 80;
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    min-height: 54px;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    box-shadow: 0 18px 42px rgba(30,12,12,.28);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
    transition: opacity .25s ease, transform .25s ease;
  }

  html.sok-menu-open .sok-mobile-plan-bar,
  body.sok-contact-page .sok-mobile-plan-bar {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
  }

  .site-footer {
    padding-bottom: 88px;
  }
}

@media (max-width: 430px) {
  :root {
    --sok-mobile-header: 102px;
  }

  .brand,
  .site-header.is-scrolled .brand {
    width: min(172px, 53vw) !important;
  }

  .brand-hero {
    min-height: 660px !important;
  }

  .brand-hero-lockup {
    width: min(286px, 78vw) !important;
  }

  .brand-hero-actions {
    inset-inline: 16px !important;
    bottom: 26px !important;
  }

  .mobile-panel {
    padding-inline: 18px;
  }

  .mobile-panel-inner > a:not(.button) {
    font-size: clamp(29px, 8.7vw, 36px);
  }

  .finder {
    grid-template-columns: 1fr !important;
  }

  .finder-heading,
  .finder-button {
    grid-column: auto !important;
  }

  .finder label {
    border-left: 0 !important;
    min-height: 92px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-panel,
  .sok-mobile-plan-bar {
    transition-duration: .01ms !important;
  }
}

/* ---------------------------------------------------------------
   «Handpicked favourites»: a grelha estava fixada em duas linhas de
   360px, feita para seis cartões. Como o bloco passou a mostrar os
   alojamentos marcados como destaque (podem ser mais), as linhas a
   seguir precisam da mesma altura, senão os cartões extra ficam com
   altura zero.
   --------------------------------------------------------------- */
@media (min-width: 761px) {
  .stays-editorial-grid { grid-auto-rows: 360px; }
}
