/* Location page (aanbod/<location>/index.html). Written for Rotterdam, meant
   to be reused by the next locations. */

@layer pages {
  /* Contents: light blue panel next to a photo cut out in the shape of the
     SILO mark, like the brochure's contents spread. */
  .contents {
    display: grid;
    background: var(--theme-color-panel);
  }

  .contents__panel {
    padding: var(--theme-space-lg) var(--theme-gutter);
  }

  .contents__title {
    margin-bottom: var(--theme-space-sm);
    font-size: var(--theme-text-xl);
  }

  .contents__list {
    max-width: 30rem;
    counter-reset: contents;
  }

  .contents__list a {
    display: flex;
    gap: var(--theme-space-xs);
    padding-block: 0.6em;
    font-size: var(--theme-text-sm);
    font-weight: var(--theme-weight-semibold);
    text-decoration: none;
    border-bottom: var(--theme-border-width) solid var(--theme-color-border);
  }

  .contents__list a:hover {
    border-bottom-color: var(--theme-color-dark);
  }

  .contents__media {
    position: relative;
    display: grid;
    align-items: end;
    padding: var(--theme-space-md) var(--theme-gutter);
  }

  .contents__media img {
    width: 100%;
    aspect-ratio: 34 / 46.72;
    max-height: 34rem;
    object-fit: cover;
  }

  .contents__media figcaption {
    position: absolute;
    left: calc(var(--theme-gutter) + 1rem);
    bottom: calc(var(--theme-space-md) + 1rem);
    max-width: 14rem;
    font-size: var(--theme-text-lg);
    font-weight: var(--theme-weight-light);
    line-height: var(--theme-leading-snug);
    color: var(--theme-color-on-dark);
    text-shadow: 0 1px 12px color-mix(in oklab, var(--theme-color-dark) 60%, transparent);
  }

  .contents__media figcaption strong {
    font-weight: var(--theme-weight-bold);
  }

  @supports (mask-image: url('x.svg')) {
    .contents__media img {
      width: auto;
      height: min(34rem, 110vw);
      max-height: none;
      margin-inline: auto;
      mask: url('../../media/brand/silo-mark.svg?v=829781ec') center / contain no-repeat;
    }
  }

  @media (width >= 56rem) {
    .contents {
      grid-template-columns: 1fr 1fr;
    }

    .contents__panel {
      padding-inline-start: max(var(--theme-gutter), (100vw - var(--theme-width-content)) / 2);
    }
  }

  /* Location: text on light blue, the map full height beside it */
  .location {
    display: grid;
    background: var(--theme-color-panel);
  }

  .location__text {
    padding: var(--theme-space-lg) var(--theme-gutter);
    font-size: var(--theme-text-sm);
  }

  .location__points {
    margin-block: var(--theme-space-sm) var(--theme-space-md);
  }

  .location__subtitle {
    margin-bottom: var(--theme-space-2xs);
    font-size: var(--theme-text-lg);
  }

  .location__times {
    max-width: 28rem;
  }

  .location__times > div {
    border-bottom-color: var(--theme-color-border-strong);
  }

  .location__map img {
    width: 100%;
    height: 100%;
    max-height: 90svh;
    object-fit: cover;
  }

  @media (width >= 56rem) {
    .location {
      grid-template-columns: 5fr 7fr;
    }

    .location__text {
      padding-inline: max(var(--theme-gutter), (100vw - var(--theme-width-content)) / 2)
        var(--theme-space-lg);
    }

    .location__map img {
      max-height: none;
    }
  }

  /* Advantages */
  .advantages__list {
    margin-top: var(--theme-space-md);
  }

  .advantages__statements {
    display: grid;
    gap: var(--theme-space-2xs);
    max-width: 22rem;
    margin-top: var(--theme-space-lg);
  }

  .advantages__media img {
    aspect-ratio: 4 / 5;
    object-fit: cover;
  }

  @media (width >= 56rem) {
    .advantages__media {
      margin-inline-end: calc(
        -1 * max(var(--theme-gutter), (100vw - var(--theme-width-content)) / 2)
      );
    }
  }

  /* Interiors: four renders edge to edge */
  .interiors__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: 4px;
    background: var(--theme-color-background);
  }

  .interiors__grid img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
  }

  /* Energy */
  .energy {
    background: var(--theme-color-surface);
  }

  .energy__text {
    font-size: var(--theme-text-sm);
  }

  /* Delivery level */
  .delivery__list {
    margin-top: var(--theme-space-md);
    font-size: var(--theme-text-sm);
  }

  .delivery__media {
    display: grid;
    gap: var(--theme-space-sm);
  }

  .delivery__media img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
  }

  .delivery__media figcaption {
    font-size: var(--theme-text-xs);
    color: var(--theme-color-text-muted);
  }

  .delivery__media figcaption strong {
    display: block;
    color: var(--theme-color-text);
  }

  @media (width >= 56rem) {
    .delivery__media {
      position: sticky;
      top: var(--theme-space-sm);
    }
  }

  .purchase__next {
    display: grid;
    gap: var(--theme-space-md);
    align-items: end;
    margin-top: var(--theme-space-lg);
  }

  .purchase__next-title {
    font-size: var(--theme-text-lg);
  }

  .purchase__claim {
    font-size: var(--theme-text-2xl);
    font-weight: var(--theme-weight-light);
    line-height: 1.1;
    color: var(--theme-color-text);
  }

  .purchase__claim strong {
    font-weight: var(--theme-weight-bold);
  }

  @media (width >= 56rem) {
    .purchase__next {
      grid-template-columns: 1fr 1fr;
    }
  }

  /* FAQ */
  .faq {
    overflow: clip;
    padding-bottom: calc(var(--theme-space-xl) + 2rem);
  }

  .faq .bar-mark {
    top: var(--theme-space-xl);
    bottom: auto;
    width: clamp(5rem, 3rem + 8vw, 11rem);
  }

  @media (width < 56rem) {
    .faq .bar-mark {
      display: none;
    }
  }

  @media (width >= 56rem) {
    .faq .accordion-basic__heading {
      padding-top: calc(clamp(5rem, 3rem + 8vw, 11rem) * 1.45);
    }
  }

  /* Units section layout */
  .units__layout {
    display: grid;
    gap: var(--theme-space-lg);
  }

  .units__layout > * {
    min-width: 0;
  }

  .units__subtitle {
    margin-bottom: var(--theme-space-xs);
    font-size: var(--theme-text-lg);
  }

  .units__note {
    margin-top: var(--theme-space-xs);
    font-size: var(--theme-text-xs);
    color: var(--theme-color-text-muted);
  }

  @media (width >= 80rem) {
    .units__layout {
      grid-template-columns: 1fr 1fr;
      align-items: start;
    }

    .units__plan {
      position: sticky;
      top: var(--theme-space-sm);
    }
  }
}
