/*
 * Office / Location page — mobile CONTENT only
 * Source: html_maket/neweditsandmobile/JBY-Office-Page
 * Do not restyle header/footer here. Desktop stays in custom_yacht_style.css.
 * Breakpoints: ≤1120 / ≤980 / ≤680 (template).
 */

/* Hours note (template .oi-sm) — same on all breakpoints */
#jb_body.page-location .location-detail__value-sm {
  display: block;
  margin-top: 0;
  font-family: "Myriad Pro", "Myriad-Pro-Light", sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 300;
  color: #575760;
}

/* ---------- Tablet: stack banner columns (template ≤1120) ---------- */
@media (max-width: 1120px) {
  #jb_body.page-location .location-detail__layout {
    flex-direction: column;
    gap: 40px;
  }

  #jb_body.page-location .location-detail__panel,
  #jb_body.page-location .location-detail__map-wrap,
  #jb_body.page-location .location-detail__map {
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
  }

  #jb_body.page-location .location-detail__panel {
    height: auto;
    gap: 40px;
  }

  #jb_body.page-location .location-detail__meta {
    margin-bottom: 0;
  }

  #jb_body.page-location .location-detail__image-wrap {
    width: 100%;
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    border-radius: 2px;
    overflow: hidden;
  }

  #jb_body.page-location .location-detail__image-inner {
    width: 100%;
    height: auto;
    aspect-ratio: 652 / 367;
  }

  #jb_body.page-location .location-detail__map-wrap {
    height: auto;
  }

  #jb_body.page-location .location-detail__map {
    height: auto;
    aspect-ratio: 652 / 591;
  }

  #jb_body.page-location .location-team__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  #jb_body.page-location .location-team__grid .team-card {
    width: 100%;
    max-width: none;
    aspect-ratio: 325 / 406;
  }
}

@media (max-width: 980px) {
  html:has(#jb_body.page-location),
  html:has(#jb_body.page-location) body {
    overflow-x: hidden;
  }
}

/* ---------- Phone (template ≤680) ---------- */
@media (max-width: 680px) {
  #jb_body.page-location {
    /* 84% of content column (20px side pads) — NOT % of max-content track */
    --office-card-w: calc((100vw - 40px) * 0.84);
    --office-team-card-w: calc((100vw - 40px) * 0.78);
  }

  #jb_body.page-location .location-detail .container,
  #jb_body.page-location .home-vessels-v2 .container,
  #jb_body.page-location .location-team .container,
  #jb_body.page-location .location-listings .container,
  #jb_body.page-location .latest-yachts-section .container {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  /* --- Banner / text block (ob-*) --- */
  #jb_body.page-location .location-detail {
    padding-top: 48px;
    padding-bottom: 64px;
  }

  #jb_body.page-location .location-detail__title {
    font-family: "Mesmerize", "Mesmerize-ex-lt", sans-serif !important;
    font-weight: 300 !important;
    font-size: 24px !important;
    line-height: 34px !important;
    letter-spacing: 0 !important;
    text-transform: uppercase;
    color: #2f2f39 !important;
    margin: 0 0 40px !important;
  }

  /* Flat 1-col info in template order: Location → Hours → Email → Phone */
  #jb_body.page-location .location-detail__meta {
    display: grid !important;
    grid-template-columns: 1fr !important;
    column-gap: 12px;
    row-gap: 20px !important;
    gap: 20px !important;
    margin-bottom: 0;
  }

  #jb_body.page-location .location-detail__meta-col {
    display: contents;
  }

  #jb_body.page-location .location-detail__field {
    margin: 0 !important;
  }

  #jb_body.page-location .location-detail__field + .location-detail__field {
    margin-top: 0 !important;
  }

  /* DOM: col1 Loc/Email, col2 Hours/Phone → template order via order */
  #jb_body.page-location .location-detail__meta-col:first-child .location-detail__field:nth-child(1) {
    order: 1;
  }
  #jb_body.page-location .location-detail__meta-col:last-child .location-detail__field:nth-child(1) {
    order: 2;
  }
  #jb_body.page-location .location-detail__meta-col:first-child .location-detail__field:nth-child(2) {
    order: 3;
  }
  #jb_body.page-location .location-detail__meta-col:last-child .location-detail__field:nth-child(2) {
    order: 4;
  }

  #jb_body.page-location .location-detail__label {
    font-family: "Mesmerize", "Mesmerize-ex-lt", sans-serif !important;
    font-weight: 300 !important;
    font-size: 20px !important;
    line-height: 28px !important;
    letter-spacing: 0 !important;
    text-transform: uppercase;
    color: #2f2f39 !important;
    margin: 0 0 12px !important;
  }

  #jb_body.page-location .location-detail__value {
    font-family: "Myriad Pro", "Myriad-Pro-Light", sans-serif !important;
    font-weight: 300 !important;
    font-size: 20px !important;
    line-height: 28px !important;
    letter-spacing: 0 !important;
    color: #575760 !important;
    margin: 0 !important;
  }

  #jb_body.page-location .location-detail__value-sm {
    display: block;
    font-size: 16px !important;
    line-height: 24px !important;
    font-weight: 300;
    color: #575760;
  }

  #jb_body.page-location .location-detail__link {
    color: inherit !important;
    text-decoration: none !important;
    transition: color 0.2s;
  }

  #jb_body.page-location .location-detail__link:hover {
    color: #41647b !important;
    text-decoration: none !important;
  }

  #jb_body.page-location .location-detail__panel {
    gap: 40px;
  }

  #jb_body.page-location .location-detail__map {
    aspect-ratio: 652 / 591;
    height: auto;
  }

  /* --- Section titles (cat-title) --- */
  #jb_body.page-location .home-vessels-v2__title,
  #jb_body.page-location .home-bespoke-v2__title.home-vessels-v2__title,
  #jb_body.page-location .latest-yachts-section .h2-style,
  #jb_body.page-location .location-listings__title,
  #jb_body.page-location .location-team__title {
    font-family: "Mesmerize", "Mesmerize-ex-lt", sans-serif !important;
    font-weight: 300 !important;
    font-size: 24px !important;
    line-height: 36px !important;
    letter-spacing: 0 !important;
    text-transform: uppercase;
    text-align: left !important;
    color: #2f2f39 !important;
    margin: 0 !important;
  }

  #jb_body.page-location .home-vessels-v2__header,
  #jb_body.page-location .latest-yachts-section__header,
  #jb_body.page-location .location-listings__header {
    flex-direction: column !important;
    flex-wrap: nowrap;
    align-items: flex-start !important;
    justify-content: flex-start;
    gap: 16px;
    margin-bottom: 28px !important;
  }

  #jb_body.page-location .home-vessels-v2 .home-bespoke-v2__btn--secondary,
  #jb_body.page-location .home-vessels-v2__catalog-btn,
  #jb_body.page-location .latest-yachts-section__catalog-btn,
  #jb_body.page-location .location-listings__catalog-btn {
    width: auto !important;
    height: 44px;
    min-height: 44px;
    padding: 0 26px !important;
    border: 0.5px solid rgba(0, 0, 0, 0.2) !important;
    border-radius: 2px !important;
    background: transparent !important;
    color: #2f2f39 !important;
    font-family: "Mesmerize", "Mesmerize-ex-lt", sans-serif !important;
    font-weight: 300 !important;
    font-size: 14px !important;
    line-height: 1 !important;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  #jb_body.page-location .home-vessels-v2 {
    padding: 0 0 64px !important;
  }

  #jb_body.page-location .location-team__title {
    margin-bottom: 28px !important;
  }

  /* --- Yachts rail (vstrip) --- */
  #jb_body.page-location .home-vessels-v2__viewport,
  #jb_body.page-location .latest-yachts-section__viewport.carousel-container {
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  #jb_body.page-location .home-vessels-v2__viewport::-webkit-scrollbar,
  #jb_body.page-location .latest-yachts-section__viewport.carousel-container::-webkit-scrollbar {
    display: none;
  }

  #jb_body.page-location .home-vessels-v2__track,
  #jb_body.page-location .latest-yachts-section .carousel-track {
    display: flex !important;
    gap: 14px !important;
    width: max-content !important;
    transform: none !important;
    transition: none !important;
    padding: 2px 0 10px;
  }

  #jb_body.page-location .home-vessels-v2__slide,
  #jb_body.page-location .latest-yachts-section .carousel-slide {
    flex: 0 0 var(--office-card-w) !important;
    flex-shrink: 0 !important;
    width: var(--office-card-w) !important;
    min-width: var(--office-card-w) !important;
    max-width: var(--office-card-w) !important;
    scroll-snap-align: start;
  }

  #jb_body.page-location .home-vessels-v2-card,
  #jb_body.page-location .home-vessels-v2-card__media {
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
  }

  #jb_body.page-location .home-vessels-v2-card__media {
    height: 390px;
  }

  /* Square strip arrows — both sides, hide via [hidden] */
  #jb_body.page-location .home-vessels-v2__nav,
  #jb_body.page-location .latest-yachts-section__nav {
    width: 44px !important;
    height: 44px !important;
    border: 0 !important;
    border-radius: 2px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    color: #fff !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    opacity: 1 !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  #jb_body.page-location .home-vessels-v2__nav[hidden],
  #jb_body.page-location .latest-yachts-section__nav[hidden] {
    display: none !important;
  }

  #jb_body.page-location .home-vessels-v2__nav:hover:not(:disabled),
  #jb_body.page-location .latest-yachts-section__nav:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.85) !important;
    transform: translateY(-50%) !important;
    opacity: 1 !important;
  }

  #jb_body.page-location .home-vessels-v2__nav--next,
  #jb_body.page-location .latest-yachts-section__nav.carousel-next {
    right: 6px !important;
    left: auto !important;
  }

  #jb_body.page-location .home-vessels-v2__nav--prev,
  #jb_body.page-location .latest-yachts-section__nav.carousel-prev {
    left: 6px !important;
    right: auto !important;
  }

  #jb_body.page-location .home-vessels-v2__nav i,
  #jb_body.page-location .latest-yachts-section__nav i {
    font-size: 18px;
    line-height: 1;
  }

  #jb_body.page-location .location-listings__grid {
    display: flex;
    overflow-x: auto;
    gap: 14px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    grid-template-columns: none;
    margin-bottom: 24px;
  }

  #jb_body.page-location .location-listings__grid::-webkit-scrollbar {
    display: none;
  }

  #jb_body.page-location .location-listings__grid > * {
    flex: 0 0 var(--office-card-w);
    width: var(--office-card-w);
    min-width: var(--office-card-w);
    scroll-snap-align: start;
  }

  #jb_body.page-location .location-listings__pagination,
  #jb_body.page-location .pager {
    display: none;
  }

  /* --- Team rail --- */
  #jb_body.page-location .location-team__strip-wrap {
    position: relative;
  }

  #jb_body.page-location .location-team__grid {
    display: flex !important;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    grid-template-columns: none !important;
    justify-content: flex-start;
    margin-bottom: 0;
  }

  #jb_body.page-location .location-team__grid::-webkit-scrollbar {
    display: none;
  }

  #jb_body.page-location .location-team__grid .team-card {
    flex: 0 0 var(--office-team-card-w);
    width: var(--office-team-card-w);
    min-width: var(--office-team-card-w);
    max-width: none;
    margin: 0;
    aspect-ratio: 325 / 406;
    scroll-snap-align: start;
  }

  #jb_body.page-location .location-team__strip-arr {
    display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    width: 44px;
    height: 44px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 0;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
  }

  #jb_body.page-location .location-team__strip-arr--next {
    right: 6px;
    left: auto;
  }

  #jb_body.page-location .location-team__strip-arr--prev {
    left: 6px;
    right: auto;
  }

  #jb_body.page-location .location-team__strip-arr:hover {
    background: rgba(0, 0, 0, 0.85);
  }

  #jb_body.page-location .location-team__strip-arr svg {
    width: 22px;
    height: 22px;
    display: block;
  }

  #jb_body.page-location .location-team__strip-arr[hidden] {
    display: none !important;
  }

  #jb_body.page-location .location-team__pagination {
    display: none;
  }

  #jb_body.page-location .location-team {
    padding-bottom: 64px;
  }
}

/* Desktop/tablet: team arrow only on phone rail */
@media (min-width: 681px) {
  #jb_body.page-location .location-team__strip-arr {
    display: none !important;
  }
}
