/* Keep the five homepage service cards fully visible at desktop viewport heights. */
@media (min-width: 761px) {
  body.home .ref-hero {
    height: clamp(520px, calc(100vh - 337px), 600px);
    min-height: 520px;
    max-height: 600px;
  }

  @supports (height: 100dvh) {
    body.home .ref-hero {
      height: clamp(520px, calc(100dvh - 337px), 600px);
    }
  }

  body.home .ref-cards {
    bottom: 46px;
  }

  body.home .ref-photo,
  body.home .ref-photo-overlay {
    height: 100%;
  }
}

@media (min-width: 761px) and (max-height: 780px) {
  body.home .ref-cards {
    bottom: 40px;
  }
}

/* Tablet home layout: two readable service-card columns, with the fifth card centered. */
@media (min-width: 761px) and (max-width: 1024px) {
  body.home .ref-hero {
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    display: block;
    padding: clamp(185px, 24vw, 260px) 0 24px;
  }

  body.home .ref-photo,
  body.home .ref-photo-overlay {
    height: 100%;
  }

  body.home .ref-cards {
    position: relative;
    inset: auto;
    width: min(92%, 900px);
    margin: 0 auto;
    padding: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
  }

  body.home .ref-card {
    height: auto;
    min-height: 0;
    padding: 18px 20px 16px;
  }

  body.home .ref-cards > .ref-card:last-child {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 8px);
  }

  body.home .card-heading {
    font-size: 11px;
    line-height: 1.25;
    margin-bottom: 12px;
  }

  body.home .ref-card h1,
  body.home .ref-card h2 {
    font-size: clamp(18px, 2.1vw, 22px);
    line-height: 1.2;
    margin: 0 0 12px;
  }

  body.home .ref-card p {
    font-size: 13px;
    line-height: 1.5;
    min-height: 0;
  }

  body.home .ref-card ul {
    min-height: 0;
    margin: 0;
  }

  body.home .ref-card li {
    font-size: 12px;
    line-height: 1.5;
  }

  body.home .ref-card > a {
    font-size: 10px;
    line-height: 1.25;
    padding: 10px;
  }
}

/* Tablet home navigation: replace the compressed horizontal links with the existing menu. */
@media (min-width: 761px) and (max-width: 1100px) {
  body.home .ref-header {
    overflow: visible;
  }

  body.home .ref-brand {
    width: calc(100% - 64px);
  }

  body.home .ref-nav {
    display: none;
  }

  body.home .fp-mobile-toggle {
    position: absolute;
    top: 50%;
    right: 22px;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 1px solid rgba(217, 180, 58, .7);
    background: rgba(5, 5, 5, .35);
    color: #e5c45d;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
  }

  body.home .fp-mobile-toggle span {
    display: block;
    width: 100%;
    height: 1px;
    background: currentColor;
    transition: transform .2s ease, opacity .2s ease;
  }

  body.home .fp-mobile-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(6px) rotate(45deg);
  }

  body.home .fp-mobile-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  body.home .fp-mobile-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-6px) rotate(-45deg);
  }

  body.home .fp-mobile-panel {
    position: absolute;
    z-index: 20;
    top: 100%;
    left: 0;
    right: 0;
    padding: 10px 18px 18px;
    flex-direction: column;
    gap: 0;
    background: rgba(5, 5, 5, .97);
    border-top: 1px solid rgba(217, 180, 58, .32);
    box-shadow: 0 16px 28px rgba(0, 0, 0, .4);
  }

  body.home .fp-mobile-panel.is-open {
    display: flex;
  }

  body.home .fp-mobile-panel a {
    box-sizing: border-box;
    display: flex;
    min-height: 44px;
    align-items: center;
    padding: 15px 2px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
  }

  body.home .fp-mobile-panel a:last-child {
    border-bottom: 0;
  }

  body.home .fp-mobile-panel a:hover {
    color: #d9ed1b;
  }

  body.home .fp-mobile-panel a:focus-visible {
    color: #d9ed1b;
    outline: 3px solid #e5c45d;
    outline-offset: 2px;
  }

  body.home .fp-mobile-panel .fp-language-switcher--flags {
    display: flex;
    align-items: center;
    align-self: flex-start;
    gap: 2px;
    width: max-content;
    margin-top: 5px;
    padding-top: 8px;
    border-top: 1px solid rgba(217, 180, 58, .32);
  }

  body.home .fp-mobile-panel .fp-language-switcher__link {
    box-sizing: border-box;
    min-height: 44px;
    padding: 0 9px;
    color: #f4f1eb;
    font-size: 11px;
    letter-spacing: .08em;
  }
}

