/* Bluejack Ranch - story */

.bjr-story {
  padding: clamp(3rem, 6vw, 7.5rem) var(--bjr-gutter) clamp(3rem, 6.5vw, 8.5rem);
  background: var(--bjr-cream);
}

/* Tabs, one per slide (built in story.js) */

.bjr-story__tabs {
  display: flex;
  justify-content: center;
  gap: clamp(1.5rem, 4.5vw, 5.75rem);
  width: 84vw;
  margin: 0 auto clamp(2.5rem, 5.5vw, 7rem);
  border-bottom: 1px solid rgba(198, 157, 102, .5);
}
.bjr-story__tab {
  margin-bottom: -1px;
  padding: 1.1em .15em;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-family: inherit;
  font-size: clamp(.8rem, 1vw, 1.25rem);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--bjr-brown);
  background: transparent;
  cursor: pointer;
  transition: color .25s ease, border-color .25s ease;
}
.bjr-story__tab:hover,
.bjr-story__tab:focus-visible,
.bjr-story__tab.is-active { color: var(--bjr-orange); }
.bjr-story__tab.is-active { border-bottom-color: var(--bjr-orange); }

/* Slides: photo one side, text the other */

.bjr-story__slides { display: grid; }
.bjr-story__slide {
  display: grid;
  grid-template-columns: 54fr 46fr;
  align-items: center;
  gap: 7vw;
  width: 84vw;
  margin: 0 auto;
}
/* without js they just stack */
.bjr-story__slide + .bjr-story__slide { margin-top: clamp(3rem, 6vw, 7.5rem); }
.bjr-story__slides.is-ready .bjr-story__slide {
  grid-area: 1 / 1;
  margin-top: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .6s ease, visibility 0s .6s;
}
.bjr-story__slides.is-ready .bjr-story__slide.is-active {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.bjr-story__media { position: relative; }
/* gold frame behind the photo */
.bjr-story__media::before {
  content: "";
  position: absolute;
  inset: 2.2vw -1.5vw;
  border: 1px solid var(--bjr-gold);
}
.bjr-story__media img {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.bjr-story__title {
  margin: 0 0 clamp(.75rem, 1.5vw, 2rem);
  font-family: var(--bjr-font-heading);
  font-weight: 400;
  font-size: clamp(2rem, 3.4vw, 4.25rem);
  line-height: 1.1;
}
.bjr-story__text {
  margin: 0;
  font-size: clamp(1.05rem, 1.45vw, 1.8rem);
  line-height: 1.57;
}
.bjr-story .bjr-btn { margin-top: clamp(1.75rem, 2.5vw, 3.25rem); }

/* Arrows + count */

.bjr-story__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 1.6vw, 2rem);
  margin-top: clamp(2.5rem, 4.5vw, 5.5rem);
}
.bjr-story__arrow {
  display: grid;
  place-items: center;
  width: clamp(44px, 3.2vw, 62px);
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--bjr-gold);
  border-radius: 50%;
  font-size: clamp(1.1rem, 1.3vw, 1.6rem);
  line-height: 1;
  color: var(--bjr-gold);
  background: transparent;
  cursor: pointer;
  transition: color .25s ease, background-color .25s ease, border-color .25s ease;
}
.bjr-story__arrow:hover,
.bjr-story__arrow:focus-visible {
  border-color: var(--bjr-orange);
  color: var(--bjr-white);
  background: var(--bjr-orange);
}
.bjr-story__count {
  min-width: 4.5em;
  font-size: clamp(.85rem, 1vw, 1.25rem);
  letter-spacing: .14em;
  text-align: center;
}

@media (max-width: 991.98px) {
  .bjr-story__tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
    width: auto;
    border-bottom: 0;
  }
  .bjr-story__tab {
    margin: 0;
    padding: 1em 0;
    border-bottom: 1px solid rgba(198, 157, 102, .5);
  }
  .bjr-story__slide {
    grid-template-columns: 1fr;
    gap: 2.75rem;
    width: auto;
    text-align: center;
  }
  .bjr-story__media { margin: 0 10px; }
  .bjr-story__media::before { inset: 1.25rem -10px; }
}
@media (prefers-reduced-motion: reduce) {
  .bjr-story__slides.is-ready .bjr-story__slide { transition: none; }
}

/* Timeline (History). Items are in Custom Modules > Timeline */

.bjr-timeline {
  --bjr-tl-card: clamp(240px, 27vw, 500px);
  --bjr-tl-year: clamp(60px, 5.8vw, 104px);
  padding: clamp(3.5rem, 5.5vw, 7rem) 0 clamp(3rem, 5vw, 6.5rem);
  overflow: hidden;
  background: var(--bjr-white);
}
.bjr-timeline__head {
  margin-bottom: clamp(1.25rem, 2.4vw, 3rem);
  padding: 0 var(--bjr-gutter);
  text-align: center;
}

/* without js it's a row you scroll sideways */
.bjr-timeline__track {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 0 calc(var(--bjr-tl-year) / 2 + 1rem);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.bjr-timeline__track::before,
.bjr-timeline__track::after {
  content: "";
  flex: 0 0 calc(50% - var(--bjr-tl-card) / 2 - 1.5rem);
}
.bjr-timeline__track:focus-visible { outline: 1px solid var(--bjr-gold); outline-offset: -1px; }
.bjr-timeline__item {
  flex: 0 0 var(--bjr-tl-card);
  scroll-snap-align: center;
}

/* with js the cards are stacked in the middle and story.js moves and sizes
   each one (transform + opacity), so it can loop */
.bjr-timeline.is-ready .bjr-timeline__track {
  display: grid;
  justify-content: center;
  overflow: hidden;
  overflow: clip; /* clip can't be scrolled, the cards are moved by the js */
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
}
.bjr-timeline.is-ready .bjr-timeline__track.is-dragging { cursor: grabbing; }
.bjr-timeline.is-ready .bjr-timeline__track::before,
.bjr-timeline.is-ready .bjr-timeline__track::after { content: none; }
.bjr-timeline.is-ready .bjr-timeline__item {
  grid-area: 1 / 1;
  width: var(--bjr-tl-card);
  will-change: transform;
  cursor: pointer;
}
.bjr-timeline.is-ready .bjr-timeline__item.is-active { cursor: inherit; }

.bjr-timeline__card {
  position: relative;
  background: var(--bjr-cream);
}
.bjr-timeline__photo {
  aspect-ratio: 7 / 6;
  background: rgba(var(--bjr-brown-rgb), .12);
}
.bjr-timeline__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}
.bjr-timeline__body {
  padding: clamp(1.1rem, 1.8vw, 2.1rem) clamp(1.1rem, 2vw, 2.4rem) calc(var(--bjr-tl-year) / 2 + clamp(.9rem, 1.4vw, 1.75rem));
  border-top: 1px solid var(--bjr-gold);
}
.bjr-timeline__title {
  margin: 0 0 .45em;
  font-family: var(--bjr-font-heading);
  font-weight: 400;
  font-size: clamp(1.25rem, 1.8vw, 2.25rem);
  line-height: 1.15;
}
.bjr-timeline__text {
  margin: 0;
  font-size: clamp(.9rem, 1vw, 1.25rem);
  line-height: 1.5;
}
/* year circle, half on the card and half below it */
.bjr-timeline__year {
  position: absolute;
  left: 50%;
  bottom: 0;
  display: grid;
  place-items: center;
  width: var(--bjr-tl-year);
  aspect-ratio: 1;
  border-radius: 50%;
  font-family: var(--bjr-font-heading);
  font-size: calc(var(--bjr-tl-year) * .31);
  line-height: 1;
  color: var(--bjr-brown);
  background: var(--bjr-gold);
  box-shadow: 0 0 0 clamp(4px, .45vw, 8px) var(--bjr-white);
  transform: translate(-50%, 50%);
}

/* Bar under the cards: a dot per item, drag or click to move (built in story.js) */

.bjr-timeline__bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(66vw, 1100px);
  height: 44px;
  margin: clamp(1rem, 2.2vw, 2.75rem) auto 0;
  padding: 0 clamp(1.25rem, 3.2vw, 4rem);
  cursor: pointer;
  touch-action: pan-y;
}
.bjr-timeline__bar::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: var(--bjr-gold);
}
/* end caps */
.bjr-timeline__bar::after {
  content: "";
  position: absolute;
  inset: calc(50% - 9px) 0;
  border-inline: 1px solid var(--bjr-gold);
  pointer-events: none;
}
.bjr-timeline__dot {
  position: relative;
  flex: none;
  width: 11px;
  height: 11px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--bjr-gold);
  cursor: pointer;
  transition: transform .3s ease, background-color .3s ease, box-shadow .3s ease;
}
.bjr-timeline__dot::after { content: ""; position: absolute; inset: -12px; }
.bjr-timeline__dot:hover,
.bjr-timeline__dot:focus-visible { transform: scale(1.4); }
.bjr-timeline__dot.is-active {
  background: var(--bjr-white);
  box-shadow: 0 0 0 1px var(--bjr-gold);
  transform: scale(2.3);
}

@media (max-width: 767.98px) {
  .bjr-timeline { --bjr-tl-card: min(68vw, 320px); }
  .bjr-timeline__bar { width: calc(100% - var(--bjr-gutter) * 4); }
}
@media (prefers-reduced-motion: reduce) {
  .bjr-timeline__dot { transition: none; }
}

/* Team: framed portrait with a side label, text beside it (photo is set in the snippet) */

.bjr-portrait {
  display: grid;
  grid-template-columns: 31.7vw 1fr;
  column-gap: 10vw;
  align-items: center;
  padding: clamp(3.5rem, 7.5vw, 9.5rem) 12.5vw clamp(3.5rem, 8vw, 10rem) 13.7vw;
  background: var(--bjr-cream);
}
.bjr-portrait__media { position: relative; }
/* gold frame behind the photo: taller and narrower than it */
.bjr-portrait__media::before {
  content: "";
  position: absolute;
  inset: -1.45vw 1.35vw;
  border: 1px solid var(--bjr-gold);
}
.bjr-portrait__media img {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 10 / 11;
  object-fit: cover;
  object-position: center 70%;
}
/* reads bottom to top, down the left side of the photo */
.bjr-portrait__label {
  position: absolute;
  top: 0;
  right: 100%;
  bottom: 0;
  margin: 0 3.4vw 0 0;
  font-size: clamp(.7rem, 1vw, 1.25rem);
  letter-spacing: .14em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--bjr-orange);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.bjr-portrait__eyebrow {
  margin: 0 0 clamp(.75rem, 1.6vw, 2rem);
  font-size: clamp(.7rem, .9vw, 1.1rem);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--bjr-orange);
}
.bjr-portrait__title {
  margin: 0 0 clamp(1rem, 2vw, 2.5rem);
  font-family: var(--bjr-font-heading);
  font-weight: 400;
  font-size: clamp(2rem, 3.7vw, 4.6rem);
  line-height: 1.15;
}
.bjr-portrait__body p:not([class]) {
  margin: 0;
  font-size: clamp(1.05rem, 1.45vw, 1.8rem);
  line-height: 1.55;
}
.bjr-portrait__body p:not([class]) + p { margin-top: 1.5em; }

/* Team: people grid (people come from Custom Modules > Team) */

.bjr-team {
  padding: clamp(3rem, 5.5vw, 7rem) 8.8vw clamp(3.5rem, 8vw, 10rem);
  background: var(--bjr-white);
}
.bjr-team .bjr-news__head { margin-bottom: clamp(2.5rem, 5.5vw, 7rem); }
.bjr-team__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(2.5rem, 5.5vw, 7rem) 4.9vw;
}
.bjr-member {
  position: relative;
  padding-bottom: clamp(1.25rem, 3vw, 3.75rem);
  text-align: center;
}
/* gold frame: a little narrower than the photo, and it carries on down around the name */
.bjr-member::before {
  content: "";
  position: absolute;
  inset: -.8vw .95vw 0;
  border: 1px solid var(--bjr-gold);
}
/* square photo, or a blank box until there is one */
.bjr-member__photo {
  position: relative;
  aspect-ratio: 1;
  background: var(--bjr-cream);
}
.bjr-member__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}
.bjr-member__name {
  position: relative;
  margin: clamp(1rem, 2vw, 2.5rem) .95vw 0;
  font-family: var(--bjr-font-heading);
  font-weight: 400;
  font-size: clamp(1.15rem, 1.6vw, 2rem);
  line-height: 1.2;
}
.bjr-member__role {
  position: relative;
  margin: .6em .95vw 0;
  font-size: clamp(.65rem, .7vw, .9rem);
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* Team: the horses, same grid with round photos (horses come from Custom Modules > Horses, A to Z) */

.bjr-horses {
  padding: clamp(3rem, 5.5vw, 7rem) 8.8vw clamp(3.5rem, 7vw, 9rem);
  background: var(--bjr-cream);
}
.bjr-horses .bjr-news__head { margin-bottom: clamp(2.5rem, 5vw, 6.5rem); }
.bjr-horses__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(2.5rem, 4.5vw, 6rem) 4.9vw;
}
.bjr-horse { text-align: center; }
/* round photo, or a blank circle until there is one */
.bjr-horse__photo {
  position: relative;
  width: 72%;
  margin: 0 auto;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bjr-white);
}
/* gold ring just outside the photo */
.bjr-horse__photo::before {
  content: "";
  position: absolute;
  inset: -.8vw;
  border: 1px solid var(--bjr-gold);
  border-radius: 50%;
}
.bjr-horse__photo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
/* with a video (Horses > Video Link): play button on hover, always there on touch screens */
.bjr-horse__photo--video { display: block; }
.bjr-horse__photo--video::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(var(--bjr-brown-rgb), .35) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Ccircle cx='24' cy='24' r='21.5' fill='none' stroke='%23fff' stroke-width='3'/%3E%3Cpath d='M19 14.5v19l15-9.5z' fill='%23fff'/%3E%3C/svg%3E") center / clamp(48px, 4.4vw, 80px) no-repeat;
  opacity: 0;
  transition: opacity .3s ease;
}
.bjr-horse__photo--video:hover::after,
.bjr-horse__photo--video:focus-visible::after { opacity: 1; }
.bjr-horse__photo--video:focus-visible { outline: 2px solid var(--bjr-orange); outline-offset: 4px; }
@media (hover: none) {
  .bjr-horse__photo--video::after { opacity: 1; background-color: rgba(var(--bjr-brown-rgb), .15); }
}
.bjr-horse__name {
  margin: clamp(1.25rem, 2.4vw, 3rem) 0 0;
  font-family: var(--bjr-font-heading);
  font-weight: 400;
  font-size: clamp(1.15rem, 1.6vw, 2rem);
  line-height: 1.2;
}

@media (max-width: 991.98px) {
  .bjr-portrait {
    grid-template-columns: 1fr;
    row-gap: 2.5rem;
    padding: 3.5rem var(--bjr-gutter);
  }
  .bjr-portrait__media { width: min(100%, 440px); margin: 0 auto 2.5rem; }
  .bjr-portrait__media::before { inset: -10px 10px; }
  /* no room at the side, so the label sits under the photo */
  .bjr-portrait__label {
    top: calc(100% + 1.6rem);
    right: 0;
    bottom: auto;
    left: 0;
    margin: 0;
    writing-mode: horizontal-tb;
    transform: none;
  }

  .bjr-team { padding-inline: var(--bjr-gutter); }
  .bjr-team__grid { grid-template-columns: 1fr 1fr; gap: 3rem 1.25rem; }
  .bjr-member::before { inset: -6px 7px 0; }
  .bjr-member__name,
  .bjr-member__role { margin-inline: 12px; }

  .bjr-horses { padding-inline: var(--bjr-gutter); }
  .bjr-horses__grid { grid-template-columns: 1fr 1fr; gap: 2.75rem 1.25rem; }
  .bjr-horse__photo { width: 80%; }
  .bjr-horse__photo::before { inset: -7px; }
}
