/* ==========================================================================
   WHITE BEARD COFFEE & ROASTERY
   Our Story — Responsive Styles
   File: /assets/css/responsive/our-story-responsive.css
   ========================================================================== */


/* ==========================================================================
   LARGE DESKTOP
   <= 1199px
   ========================================================================== */

@media (max-width: 1199px) {
  .story-hero__grid {
    grid-template-columns:
      minmax(0, 0.86fr)
      minmax(0, 1.14fr);
  }

  .story-hero__content {
    padding-right: var(--space-2xl);
  }

  .story-hero__title {
    font-size: clamp(4.5rem, 7vw, 7rem);
  }

  .story-beginning__grid {
    column-gap: clamp(3rem, 6vw, 6rem);
  }

  .story-origin__header,
  .story-origin__details {
    column-gap: var(--space-3xl);
  }

  .story-craft__grid {
    column-gap: clamp(3rem, 6vw, 6rem);
  }

  .story-community__grid {
    column-gap: clamp(3rem, 6vw, 6rem);
  }

  .story-event__link {
    gap: var(--space-2xl);
  }
}


/* ==========================================================================
   TABLET
   <= 991px
   ========================================================================== */

@media (max-width: 991px) {
  /* Reading progress */

  .story-progress {
    top: var(--header-height);
  }


  /* Hero */

  .story-hero {
    min-height: auto;
  }

  .story-hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .story-hero__content {
    min-height: auto;
    padding:
      calc(var(--header-height) + var(--space-4xl))
      var(--container-padding)
      var(--space-3xl);
    text-align: left;
  }

  .story-hero__chapter,
  .story-hero__year {
    justify-content: flex-start;
  }

  .story-hero__title {
    max-width: 10ch;
    font-size: clamp(4rem, 11vw, 6.5rem);
  }

  .story-hero__lead {
    max-width: 38rem;
    margin-right: 0;
    margin-left: 0;
  }

  .story-hero__media {
    min-height: 34rem;
  }

  .story-hero__picture {
    min-height: inherit;
    aspect-ratio: 16 / 10;
  }

  .story-hero__image {
    min-height: inherit;
  }


  /* Chapter navigation */

  .story-chapter-nav {
    overflow: hidden;
  }

  .story-chapter-nav__inner {
    justify-content: flex-start;
    overflow-x: auto;
    padding-right: var(--container-padding);
    padding-left: var(--container-padding);
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .story-chapter-nav__inner::-webkit-scrollbar {
    display: none;
  }

  .story-chapter-nav__label {
    flex: 0 0 auto;
  }

  .story-chapter-nav__link {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;
  }


  /* Beginning */

  .story-beginning__grid {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-3xl);
  }

  .story-beginning__content {
    max-width: 42rem;
  }

  .story-beginning__media {
    width: min(100%, 38rem);
    margin-left: auto;
  }

  .story-beginning__number {
    right: auto;
    left: calc(var(--space-xl) * -1);
  }


  /* Origin */

  .story-origin__header,
  .story-origin__details {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-xl);
  }

  .story-origin__lead,
  .story-origin__copy {
    max-width: 42rem;
  }

  .story-origin__media {
    width: 100%;
    margin-left: 0;
  }

  .story-origin__picture {
    aspect-ratio: 16 / 10;
  }


  /* Craft */

  .story-craft__grid {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-4xl);
  }

  .story-craft__media {
    width: min(100%, 44rem);
    margin-right: auto;
    margin-left: auto;
  }

  .story-craft__content {
    max-width: 44rem;
  }

  .story-craft__principles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }


  /* People */

  .story-people__header {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-xl);
  }

  .story-people__lead {
    max-width: 38rem;
  }

  .story-people__mosaic {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-people__item--primary {
    grid-column: 1 / -1;
  }

  .story-people__item--secondary,
  .story-people__item--tertiary {
    grid-column: auto;
  }


  /* Community */

  .story-community__grid {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-3xl);
  }

  .story-community__content {
    max-width: 42rem;
  }

  .story-community__gallery {
    width: min(100%, 46rem);
    margin-right: auto;
    margin-left: auto;
  }


  /* Events */

  .story-events__header {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-lg);
  }

  .story-events__intro {
    max-width: 40rem;
  }

  .story-events__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-event__link {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .story-event__figure {
    aspect-ratio: 4 / 3;
  }


  /* Closing */

  .story-closing__content {
    width: min(100%, 46rem);
  }
}


/* ==========================================================================
   MOBILE
   <= 767px
   ========================================================================== */

@media (max-width: 767px) {
  /* Shared story typography */

  .story-heading {
    font-size: clamp(2.6rem, 11vw, 4rem);
  }

  .story-lead {
    font-size: clamp(1.15rem, 5vw, 1.4rem);
  }

  .story-copy {
    font-size: 1rem;
  }


  /* Hero */

  .story-hero__content {
    padding-top:
      calc(var(--header-height) + var(--space-3xl));
    padding-bottom: var(--space-2xl);
  }

  .story-hero__chapter {
    gap: var(--space-sm);
  }

  .story-hero__chapter-number {
    font-size: var(--text-xs);
  }

  .story-hero__title {
    max-width: 9ch;
    margin-top: var(--space-lg);
    font-size: clamp(3.6rem, 17vw, 5.5rem);
    line-height: 0.88;
  }

  .story-hero__lead {
    margin-top: var(--space-xl);
    font-size: clamp(1.1rem, 5vw, 1.35rem);
  }

  .story-hero__year {
    margin-top: var(--space-2xl);
  }

  .story-hero__year-value {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }

  .story-hero__media {
    min-height: 26rem;
  }

  .story-hero__picture {
    aspect-ratio: 4 / 3;
  }

  .story-hero__caption {
    right: var(--container-padding);
    bottom: var(--space-md);
    left: var(--container-padding);
  }


  /* Chapter navigation */

  .story-chapter-nav__inner {
    gap: var(--space-xl);
  }

  .story-chapter-nav__label {
    display: none;
  }

  .story-chapter-nav__link {
    min-height: 3.75rem;
    font-size: var(--text-xs);
  }


  /* Section spacing */

  .story-beginning,
  .story-origin,
  .story-people,
  .story-community,
  .story-events {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }

  .story-craft {
    padding-top: 5.5rem;
    padding-bottom: 5.5rem;
  }


  /* Beginning */

  .story-beginning__grid {
    row-gap: var(--space-2xl);
  }

  .story-beginning__content {
    max-width: none;
  }

  .story-beginning__media {
    width: 100%;
    margin: 0;
  }

  .story-beginning__picture {
    aspect-ratio: 4 / 5;
  }

  .story-beginning__number {
    position: static;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    writing-mode: initial;
    transform: none;
  }

  .story-beginning__number::after {
    width: 3rem;
    height: 1px;
  }


  /* Origin */

  .story-origin__header {
    margin-bottom: var(--space-2xl);
  }

  .story-origin__media {
    width: calc(100% + (var(--container-padding) * 2));
    margin-left: calc(var(--container-padding) * -1);
  }

  .story-origin__picture {
    aspect-ratio: 4 / 3;
  }

  .story-origin__caption {
    padding-right: var(--container-padding);
    padding-left: var(--container-padding);
  }

  .story-origin__details {
    margin-top: var(--space-2xl);
  }


  /* Craft */

  .story-craft__grid {
    row-gap: var(--space-3xl);
  }

  .story-craft__media {
    width: 100%;
  }

  .story-craft__primary {
    width: calc(100% - var(--space-xl));
  }

  .story-craft__primary-picture {
    aspect-ratio: 4 / 5;
  }

  .story-craft__secondary {
    width: min(52%, 14rem);
    margin-top: -28%;
    margin-left: auto;
  }

  .story-craft__secondary-picture {
    aspect-ratio: 1 / 1;
  }

  .story-craft__content {
    max-width: none;
  }

  .story-craft__principles {
    grid-template-columns: minmax(0, 1fr);
    margin-top: var(--space-2xl);
  }

  .story-craft__principle {
    padding-top: var(--space-lg);
  }


  /* People */

  .story-people__header {
    margin-bottom: var(--space-2xl);
  }

  .story-people__mosaic {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-lg);
  }

  .story-people__item,
  .story-people__item--primary,
  .story-people__item--secondary,
  .story-people__item--tertiary {
    grid-column: auto;
    grid-row: auto;
  }

  .story-people__item--primary .story-people__picture {
    aspect-ratio: 4 / 5;
  }

  .story-people__item--secondary .story-people__picture,
  .story-people__item--tertiary .story-people__picture {
    aspect-ratio: 4 / 3;
  }


  /* Community */

  .story-community__grid {
    row-gap: var(--space-2xl);
  }

  .story-community__gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm);
    width: 100%;
  }

  .story-community__media {
    margin: 0;
  }

  .story-community__picture {
    aspect-ratio: 3 / 4;
  }

  .story-community__media--archive {
    margin-top: var(--space-2xl);
  }


  /* Events */

  .story-events__list {
    grid-template-columns: minmax(0, 1fr);
  }

  .story-event__content {
    padding: var(--space-xl);
  }

  .story-event__figure {
    aspect-ratio: 16 / 10;
  }

  .story-event__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }

  .story-event__title {
    font-size: clamp(1.7rem, 8vw, 2.4rem);
  }


  /* Closing */

  .story-closing {
    min-height: auto;
    padding-top: 6rem;
    padding-bottom: 6rem;
  }

  .story-closing__title {
    font-size: clamp(3rem, 14vw, 5rem);
  }

  .story-closing__actions {
    justify-content: center;
  }
}


/* ==========================================================================
   SMALL MOBILE
   <= 479px
   ========================================================================== */

@media (max-width: 479px) {
  .story-hero__title {
    font-size: clamp(3.15rem, 17vw, 4.4rem);
  }

  .story-hero__media {
    min-height: 22rem;
  }

  .story-hero__picture {
    aspect-ratio: 3 / 4;
  }

  .story-chapter-nav__inner {
    gap: var(--space-lg);
  }

  .story-beginning__picture {
    aspect-ratio: 3 / 4;
  }

  .story-craft__primary {
    width: calc(100% - var(--space-md));
  }

  .story-craft__secondary {
    width: 56%;
    margin-top: -32%;
  }

  .story-community__gallery {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-md);
  }

  .story-community__picture {
    aspect-ratio: 4 / 3;
  }

  .story-community__media--archive {
    margin-top: 0;
  }

  .story-event__figure {
    aspect-ratio: 4 / 3;
  }

  .story-closing__actions {
    flex-direction: column;
    align-items: stretch;
    width: min(100%, 22rem);
    margin-right: auto;
    margin-left: auto;
  }

  .story-closing__actions .wb-button {
    width: 100%;
    justify-content: center;
  }
}


/* ==========================================================================
   SHORT LANDSCAPE DEVICES
   ========================================================================== */

@media (max-height: 620px) and (orientation: landscape) {
  .story-hero__content {
    padding-top:
      calc(var(--header-height) + var(--space-2xl));
    padding-bottom: var(--space-2xl);
  }

  .story-hero__title {
    font-size: clamp(3.4rem, 10vw, 5rem);
  }

  .story-hero__media {
    min-height: 24rem;
  }

  .story-closing {
    min-height: auto;
  }
}


/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .story-progress__bar,
  .story-chapter-nav__link,
  .story-hero__image,
  .story-origin__image,
  .story-beginning__image,
  .story-craft__image,
  .story-people__image,
  .story-community__image,
  .story-event__image {
    transition: none;
  }

  .story-hero__image,
  .story-origin__image,
  .story-beginning__image,
  .story-craft__image,
  .story-people__image,
  .story-community__image,
  .story-event__image {
    transform: none !important;
  }

  .story-chapter-nav__inner {
    scroll-behavior: auto;
  }
}


/* ==========================================================================
   PRINT
   ========================================================================== */

@media print {
  .story-progress,
  .story-chapter-nav,
  .story-closing__actions {
    display: none !important;
  }

  .story-hero,
  .story-beginning,
  .story-origin,
  .story-craft,
  .story-people,
  .story-community,
  .story-events,
  .story-closing {
    min-height: auto;
    padding-top: 2rem;
    padding-bottom: 2rem;
    color: #000;
    background: #fff;
  }

  .story-hero__grid,
  .story-beginning__grid,
  .story-origin__header,
  .story-origin__details,
  .story-craft__grid,
  .story-people__header,
  .story-community__grid {
    display: block;
  }

  .story-hero__content {
    min-height: auto;
    padding: 2rem 0;
  }

  .story-hero__media,
  .story-beginning__media,
  .story-origin__media,
  .story-craft__media,
  .story-community__gallery {
    margin-top: 2rem;
    break-inside: avoid;
  }

  .story-hero__image,
  .story-origin__image,
  .story-beginning__image,
  .story-craft__image,
  .story-people__image,
  .story-community__image,
  .story-event__image {
    transform: none !important;
  }

  .story-event,
  .story-people__item {
    break-inside: avoid;
  }
}